feat: quick new service script

This commit is contained in:
cha0s 2018-12-24 13:20:29 -06:00
parent 4317d341c6
commit dc9ffcbd0e

19
new-service.sh Executable file
View File

@ -0,0 +1,19 @@
SERVICE=$1
cp -r services/default "services/$SERVICE"
JSON="
const fs = require('fs');
const json = JSON.parse(fs.readFileSync('services/default/package.json'));
const rewritten = Object.assign(
json,
{
name: '$SERVICE',
description: '',
}
);
const emission = JSON.stringify(rewritten, null, ' ');
fs.writeFileSync('services/$SERVICE/package.json', emission);
"
echo $JSON | node -