idk stuff that should be defaults

materials
Valerie 2021-07-25 21:07:10 -04:00
parent 2e670c59fd
commit 730ba1af3f
2 changed files with 39 additions and 6 deletions

31
.vscode/tasks.json vendored
View File

@ -23,7 +23,10 @@
"problemMatcher": {
"base": "$tsc-watch",
"applyTo": "allDocuments"
}
},
"dependsOn": [
"install deps"
]
},
{
"label": "dev",
@ -41,6 +44,27 @@
"panel": "shared",
"group": "main"
},
"problemMatcher": [],
"dependsOn": [
"install deps"
]
},
{
"label": "install deps",
"type": "npm",
"script": "install",
"isBackground": true,
"group": "build",
"runOptions": {
"runOn": "folderOpen"
},
"presentation": {
"reveal": "never",
"echo": false,
"focus": false,
"panel": "shared",
"group": "main"
},
"problemMatcher": []
},
{
@ -59,7 +83,10 @@
"panel": "shared",
"group": "main"
},
"problemMatcher": []
"problemMatcher": [],
"dependsOn": [
"install deps"
]
}
]
}

View File

@ -11,7 +11,7 @@ import chalk from 'chalk';
ipc.config.silent = true;
const exec = 'yarn';
const exec = 'yarn' + (process.platform === "win32" ? '.cmd' : '');
const args = [
'start'
]
@ -31,7 +31,9 @@ let proc: ChildProcess = null;
function startProcess() {
proc = spawn(exec, args, {
stdio: 'inherit'
stdio: 'inherit',
cwd: process.cwd(),
env: process.env
});
console.log(`[${proc.pid}] ${chalk.grey(`${exec} ${args.join(' ')}`)}`);
proc.on('exit', () => {
@ -55,8 +57,12 @@ async function killProcess() {
}
async function restart() {
await killProcess();
startProcess();
if(proc) {
await killProcess();
startProcess();
} else {
startProcess();
}
}
startProcess();