Browse Source

Add 'dev-tye' func to `activate` scripts to improve local dev flow (#306)

davidfowl/aspnet-urls
Andrew Stanton-Nurse 7 years ago
committed by GitHub
parent
commit
ba102c31d1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      activate.ps1
  2. 5
      activate.sh

8
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
}
}

5
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
}

Loading…
Cancel
Save