ReplNodeEnv/tool.js

15 lines
463 B
JavaScript
Raw Permalink Normal View History

2021-10-16 10:56:56 +00:00
const fs = require(`fs`);
2021-10-16 11:06:19 +00:00
console.info(`Please note that this tool currently only supports one single file. It may be improved in the future.`);
2021-10-16 10:56:56 +00:00
if (process.argv.length === 3) {
fs.readFile(process.argv[2], (error, data) => {
if (error) console.error(error);
else {
2021-10-16 11:07:49 +00:00
console.log(`Paste the following code into the Raw Secrets Editor:\n\n`, JSON.stringify({
2021-10-16 10:56:56 +00:00
code: data.toString(`base64`)
}));
}
})
} else {
2021-10-16 11:06:19 +00:00
console.error(`Usage: <infile.js>`);
2021-10-16 10:56:56 +00:00
}