From ba102c31d17968638f381686bc657b6d7c26cc96 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Tue, 7 Apr 2020 10:03:19 -0700 Subject: [PATCH] Add 'dev-tye' func to `activate` scripts to improve local dev flow (#306) --- activate.ps1 | 8 +++++++- activate.sh | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/activate.ps1 b/activate.ps1 index bc6f326e..4021aa29 100644 --- a/activate.ps1 +++ b/activate.ps1 @@ -11,6 +11,11 @@ if ($MyInvocation.CommandOrigin -eq 'runspace') { exit 1 } +function tye() { + $ProjectPath = Join-Path (Join-Path $PSScriptRoot "src") "tye" + dotnet run --project "$ProjectPath" @args +} + function deactivate ([switch]$init) { # reset old environment variables @@ -27,8 +32,9 @@ function deactivate ([switch]$init) { Remove-Item env:DOTNET_ROOT -ea ignore Remove-Item env:DOTNET_MULTILEVEL_LOOKUP -ea ignore if (-not $init) { - # Remove the deactivate function + # Remove the deactivate and dev-tye functions Remove-Item function:deactivate + Remove-Item function:tye } } diff --git a/activate.sh b/activate.sh index 4986e1b2..d4a3fbd5 100755 --- a/activate.sh +++ b/activate.sh @@ -32,6 +32,10 @@ if [ $sourced -eq 0 ]; then exit 1 fi +tye () { + dotnet run --project "$THIS_SCRIPT/src/tye" "$@" +} + deactivate () { # reset old environment variables @@ -57,6 +61,7 @@ deactivate () { if [ ! "${1:-}" = "init" ] ; then # Remove the deactivate function unset -f deactivate + unset -f tye fi }