diff --git a/.github/workflows/create-artifact.yml b/.github/workflows/create-artifact.yml index bda119c..e5be214 100644 --- a/.github/workflows/create-artifact.yml +++ b/.github/workflows/create-artifact.yml @@ -15,17 +15,17 @@ jobs: - os: macos arch: x64 runner: macos-15-intel - target: node24-macos-x64 + target: node20-macos-x64 extension: "" - os: macos arch: arm64 runner: macos-latest - target: node24-macos-arm64 + target: node20-macos-arm64 extension: "" - os: linux arch: x64 runner: ubuntu-latest - target: node24-linux-x64 + target: node20-linux-x64 extension: "" - os: linux arch: arm64 @@ -35,12 +35,12 @@ jobs: - os: win arch: x64 runner: windows-latest - target: node24-win-x64 + target: node20-win-x64 extension: ".exe" - os: win arch: arm64 runner: windows-11-arm - target: node24-win-arm64 + target: node20-win-arm64 extension: ".exe" steps: @@ -50,7 +50,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v3 with: - node-version: "24.x" + node-version: "20.x" - name: Setup safe-chain run: | diff --git a/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-fish.fish b/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-fish.fish index 235ecb8..81e28ef 100644 --- a/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-fish.fish +++ b/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-fish.fish @@ -1,3 +1,5 @@ +set -gx PATH $PATH $HOME/.safe-chain/bin + function printSafeChainWarning set original_cmd $argv[1] @@ -17,41 +19,40 @@ end function wrapSafeChainCommand set original_cmd $argv[1] - set aikido_cmd $argv[2] - set cmd_args $argv[3..-1] - - if type -q $aikido_cmd - # If the aikido command is available, just run it with the provided arguments - $aikido_cmd $cmd_args + set cmd_args $argv[2..-1] + + if type -q safe-chain + # If the safe-chain command is available, just run it with the provided arguments + safe-chain $original_cmd $cmd_args else - # If the aikido command is not available, print a warning and run the original command + # If the safe-chain command is not available, print a warning and run the original command printSafeChainWarning $original_cmd command $original_cmd $cmd_args end end function npx - wrapSafeChainCommand "npx" "aikido-npx" $argv + wrapSafeChainCommand "npx" $argv end function yarn - wrapSafeChainCommand "yarn" "aikido-yarn" $argv + wrapSafeChainCommand "yarn" $argv end function pnpm - wrapSafeChainCommand "pnpm" "aikido-pnpm" $argv + wrapSafeChainCommand "pnpm" $argv end function pnpx - wrapSafeChainCommand "pnpx" "aikido-pnpx" $argv + wrapSafeChainCommand "pnpx" $argv end function bun - wrapSafeChainCommand "bun" "aikido-bun" $argv + wrapSafeChainCommand "bun" $argv end function bunx - wrapSafeChainCommand "bunx" "aikido-bunx" $argv + wrapSafeChainCommand "bunx" $argv end function npm @@ -66,27 +67,28 @@ function npm end end - wrapSafeChainCommand "npm" "aikido-npm" $argv + wrapSafeChainCommand "npm" $argv end + function pip - wrapSafeChainCommand "pip" "aikido-pip" $argv + wrapSafeChainCommand "pip" $argv end function pip3 - wrapSafeChainCommand "pip3" "aikido-pip3" $argv + wrapSafeChainCommand "pip3" $argv end function uv - wrapSafeChainCommand "uv" "aikido-uv" $argv + wrapSafeChainCommand "uv" $argv end # `python -m pip`, `python -m pip3`. function python - wrapSafeChainCommand "python" "aikido-python" $argv + wrapSafeChainCommand "python" $argv end # `python3 -m pip`, `python3 -m pip3'. function python3 - wrapSafeChainCommand "python3" "aikido-python3" $argv + wrapSafeChainCommand "python3" $argv end diff --git a/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-posix.sh b/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-posix.sh index 9f51010..fd844fc 100644 --- a/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-posix.sh +++ b/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-posix.sh @@ -1,3 +1,4 @@ +export PATH="$PATH:$HOME/.safe-chain/bin" function printSafeChainWarning() { # \033[43;30m is used to set the background color to yellow and text color to black @@ -9,15 +10,10 @@ function printSafeChainWarning() { function wrapSafeChainCommand() { local original_cmd="$1" - local aikido_cmd="$2" - # Remove the first 2 arguments (original_cmd and aikido_cmd) from $@ - # so that "$@" now contains only the arguments passed to the original command - shift 2 - - if command -v "$aikido_cmd" > /dev/null 2>&1; then + if command -v safe-chain > /dev/null 2>&1; then # If the aikido command is available, just run it with the provided arguments - "$aikido_cmd" "$@" + safe-chain "$@" else # If the aikido command is not available, print a warning and run the original command printSafeChainWarning "$original_cmd" @@ -27,27 +23,27 @@ function wrapSafeChainCommand() { } function npx() { - wrapSafeChainCommand "npx" "aikido-npx" "$@" + wrapSafeChainCommand "npx" "$@" } function yarn() { - wrapSafeChainCommand "yarn" "aikido-yarn" "$@" + wrapSafeChainCommand "yarn" "$@" } function pnpm() { - wrapSafeChainCommand "pnpm" "aikido-pnpm" "$@" + wrapSafeChainCommand "pnpm" "$@" } function pnpx() { - wrapSafeChainCommand "pnpx" "aikido-pnpx" "$@" + wrapSafeChainCommand "pnpx" "$@" } function bun() { - wrapSafeChainCommand "bun" "aikido-bun" "$@" + wrapSafeChainCommand "bun" "$@" } function bunx() { - wrapSafeChainCommand "bunx" "aikido-bunx" "$@" + wrapSafeChainCommand "bunx" "$@" } function npm() { @@ -58,27 +54,28 @@ function npm() { return fi - wrapSafeChainCommand "npm" "aikido-npm" "$@" + wrapSafeChainCommand "npm" "$@" } + function pip() { - wrapSafeChainCommand "pip" "aikido-pip" "$@" + wrapSafeChainCommand "pip" "$@" } function pip3() { - wrapSafeChainCommand "pip3" "aikido-pip3" "$@" + wrapSafeChainCommand "pip3" "$@" } function uv() { - wrapSafeChainCommand "uv" "aikido-uv" "$@" + wrapSafeChainCommand "uv" "$@" } # `python -m pip`, `python -m pip3`. function python() { - wrapSafeChainCommand "python" "aikido-python" "$@" + wrapSafeChainCommand "python" "$@" } # `python3 -m pip`, `python3 -m pip3'. function python3() { - wrapSafeChainCommand "python3" "aikido-python3" "$@" + wrapSafeChainCommand "python3" "$@" } diff --git a/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-pwsh.ps1 b/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-pwsh.ps1 index deb127d..27a5065 100644 --- a/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-pwsh.ps1 +++ b/packages/safe-chain/src/shell-integration/startup-scripts/include-python/init-pwsh.ps1 @@ -1,3 +1,5 @@ +$env:PATH = "$env:PATH;$HOME/.safe-chain/bin" + function Write-SafeChainWarning { param([string]$Command) diff --git a/packages/safe-chain/src/shell-integration/startup-scripts/init-fish.fish b/packages/safe-chain/src/shell-integration/startup-scripts/init-fish.fish index a72380f..f697da2 100644 --- a/packages/safe-chain/src/shell-integration/startup-scripts/init-fish.fish +++ b/packages/safe-chain/src/shell-integration/startup-scripts/init-fish.fish @@ -1,3 +1,5 @@ +set -gx PATH $PATH $HOME/.safe-chain/bin + function printSafeChainWarning set original_cmd $argv[1] diff --git a/packages/safe-chain/src/shell-integration/startup-scripts/init-posix.sh b/packages/safe-chain/src/shell-integration/startup-scripts/init-posix.sh index a83e749..6d426c5 100644 --- a/packages/safe-chain/src/shell-integration/startup-scripts/init-posix.sh +++ b/packages/safe-chain/src/shell-integration/startup-scripts/init-posix.sh @@ -1,3 +1,4 @@ +export PATH="$PATH:$HOME/.safe-chain/bin" function printSafeChainWarning() { # \033[43;30m is used to set the background color to yellow and text color to black diff --git a/packages/safe-chain/src/shell-integration/startup-scripts/init-pwsh.ps1 b/packages/safe-chain/src/shell-integration/startup-scripts/init-pwsh.ps1 index 2106cac..17ddeb2 100644 --- a/packages/safe-chain/src/shell-integration/startup-scripts/init-pwsh.ps1 +++ b/packages/safe-chain/src/shell-integration/startup-scripts/init-pwsh.ps1 @@ -1,3 +1,5 @@ +$env:PATH = "$env:PATH;$HOME/.safe-chain/bin" + function Write-SafeChainWarning { param([string]$Command)