Initial commit from prod-batam
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import fs from 'fs';
|
||||
|
||||
export default function writePluginConfigFile(pluginConfig) {
|
||||
// Note: Second 2 arguments are to pretty print the JSON so its human readable.
|
||||
const jsonStringOfFileContents = JSON.stringify(pluginConfig, null, 2);
|
||||
|
||||
fs.writeFileSync(
|
||||
`./pluginConfig.json`,
|
||||
jsonStringOfFileContents + '\n', // Add a newline character at the end
|
||||
{ flag: 'w+' },
|
||||
err => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user