feat: quick new service script
This commit is contained in:
parent
4317d341c6
commit
dc9ffcbd0e
19
new-service.sh
Executable file
19
new-service.sh
Executable 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 -
|
Loading…
Reference in New Issue
Block a user