Shorten and improve output

This commit is contained in:
Julia 2021-10-16 13:06:19 +02:00
parent 8c06514337
commit aa7c4f2bc1
1 changed files with 3 additions and 4 deletions

View File

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