From b35f2df597ae7da9c87c68b4b72eefcb6b3b8dfa Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 13 Apr 2021 16:35:19 -0400 Subject: [PATCH] Add run script, and VSCode build task --- .vscode/tasks.json | 21 +++++++++++++++++++++ README.md | 2 ++ bin/run | 3 +++ 3 files changed, 26 insertions(+) create mode 100644 .vscode/tasks.json create mode 100755 bin/run 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'