diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..92c2e54 --- /dev/null +++ b/.vscode/tasks.json @@ -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" + } + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 6a9b266..18290be 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,5 @@ nix-shell --run 'cargo run' # 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`). diff --git a/bin/run b/bin/run new file mode 100755 index 0000000..a227217 --- /dev/null +++ b/bin/run @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +set -xe +exec nix-shell --run 'cargo watch -x run'