Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
success: function(response) {
loadTriggers(response);
// save triggers to local backup
jetpack.remove("triggers.json");
jetpack.write("triggers.json", response);
},
error: function() {
licenseInfo.licenseText || `license: ${licenseInfo.license}${os.EOL}authors: ${licenseInfo.authors}`].join(os.EOL);
}).value();
var attribution = attributionSequence.join(`${os.EOL}${os.EOL}******************************${os.EOL}${os.EOL}`);
var headerPath = path.join(options.outputDir, 'header.txt');
if (jetpack.exists(headerPath)) {
var template = jetpack.read(headerPath);
console.log('using template', template);
attribution = template + os.EOL + os.EOL + attribution;
}
jetpack.write(path.join(options.outputDir, 'licenseInfos.json'), JSON.stringify(licenseInfos));
return jetpack.write(path.join(options.outputDir, 'attribution.txt'), attribution);
})
.catch(e => {
return _pullStats(engine).then(stats => {
vorpal.activeCommand.log('Dumping debug information...');
const data = {stats, store: engine._debug({raw: false})};
jetpack.write(file, data, {jsonIndent: 0});
const path = Path.resolve(process.cwd(), file);
vorpal.activeCommand.log(`Dumped successfully to ${path}`);
});
}
set(name, value) {
this.all[name] = value;
jetpack.write(this.path, this.all);
}
function writeFrontendConfig() {
/*
Since ream can't execute getInitialData on non-routes we write a config file for it.
*/
const template = oneliner`
module.exports = {
version: '${process.env.npm_package_version}',
URL: '${config.filesServeLocation}',
baseURL: '${config.backendLocation}',
serviceName: '${config.serviceName}',
maxFileSize: '${config.uploads.uploadMaxSize}',
chunkSize: '${config.uploads.chunkSize}',
maxLinksPerAlbum: '${config.albums.maxLinksPerAlbum}'
}`;
jetpack.write(path.join(__dirname, 'site', 'config.js'), template);
log.success('Frontend config file generated successfully');
}
delete(name) {
delete this.all[name];
jetpack.write(this.path, this.all);
}
before( () => {
const config = { key2: "val-from-file", key3: "val3" };
fs.write( otherConfigFile, config );
store = new ConfigStorage( { key1: "val1", key2: "val2" }, false );
store.loadFromFile( otherConfigFile );
} );
clear() {
this.all = {};
jetpack.write(this.path, this.all);
}
}