Add run script, and VSCode build task

This commit is contained in:
Sridhar Ratnakumar 2021-04-13 16:35:19 -04:00
parent 0de7a6e480
commit b35f2df597
3 changed files with 26 additions and 0 deletions

21
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,21 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "cargo watch",
"type": "shell",
"command": "bin/run",
"args": [],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"runOptions": {
"runOn": "folderOpen"
}
}
]
}

View file

@ -37,3 +37,5 @@ nix-shell --run 'cargo run'
# build # build
nix-build nix-build
``` ```
There is a also a `bin/run` script which starts 'cargo watch'; and it is used by VSCode as well (`Ctrl+Shift+B`).

3
bin/run Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -xe
exec nix-shell --run 'cargo watch -x run'