Initial commit from prod-batam
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import fs from 'fs';
|
||||
|
||||
export default function readPluginConfigFile() {
|
||||
let fileContents;
|
||||
|
||||
try {
|
||||
fileContents = fs.readFileSync('./pluginConfig.json', { flag: 'r' });
|
||||
} catch (err) {
|
||||
return; // File doesn't exist yet.
|
||||
}
|
||||
|
||||
if (fileContents) {
|
||||
fileContents = JSON.parse(fileContents);
|
||||
}
|
||||
|
||||
return fileContents;
|
||||
}
|
||||
Reference in New Issue
Block a user