From a3bff105ccaf9c1e759c9006e0616f93482e8b59 Mon Sep 17 00:00:00 2001 From: Sander Declerck Date: Fri, 28 Nov 2025 14:01:11 +0100 Subject: [PATCH] Update startup scripts to use safe-chain instead of aikido-* --- packages/safe-chain/bin/safe-chain.js | 1 - .../include-python/init-pwsh.ps1 | 31 +++++++++---------- .../startup-scripts/init-fish.fish | 27 ++++++++-------- 3 files changed, 28 insertions(+), 31 deletions(-) diff --git a/packages/safe-chain/bin/safe-chain.js b/packages/safe-chain/bin/safe-chain.js index 48f38c5..3f32bff 100755 --- a/packages/safe-chain/bin/safe-chain.js +++ b/packages/safe-chain/bin/safe-chain.js @@ -45,7 +45,6 @@ const pkgManagerCommands = [ ]; if (pkgManagerCommands.includes(command)) { - ui.writeInformation(process.argv.join(", ")); setEcoSystem(ECOSYSTEM_JS); initializePackageManager(command); (async () => { 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 e2ea1c9..deb127d 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 @@ -39,12 +39,11 @@ function Invoke-RealCommand { function Invoke-WrappedCommand { param( [string]$OriginalCmd, - [string]$AikidoCmd, [string[]]$Arguments ) - if (Test-CommandAvailable $AikidoCmd) { - & $AikidoCmd @Arguments + if (Test-CommandAvailable "safe-chain") { + & safe-chain $OriginalCmd @Arguments } else { Write-SafeChainWarning $OriginalCmd @@ -53,27 +52,27 @@ function Invoke-WrappedCommand { } function npx { - Invoke-WrappedCommand "npx" "aikido-npx" $args + Invoke-WrappedCommand "npx" $args } function yarn { - Invoke-WrappedCommand "yarn" "aikido-yarn" $args + Invoke-WrappedCommand "yarn" $args } function pnpm { - Invoke-WrappedCommand "pnpm" "aikido-pnpm" $args + Invoke-WrappedCommand "pnpm" $args } function pnpx { - Invoke-WrappedCommand "pnpx" "aikido-pnpx" $args + Invoke-WrappedCommand "pnpx" $args } function bun { - Invoke-WrappedCommand "bun" "aikido-bun" $args + Invoke-WrappedCommand "bun" $args } function bunx { - Invoke-WrappedCommand "bunx" "aikido-bunx" $args + Invoke-WrappedCommand "bunx" $args } function npm { @@ -83,29 +82,29 @@ function npm { Invoke-RealCommand "npm" $args return } - - Invoke-WrappedCommand "npm" "aikido-npm" $args + + Invoke-WrappedCommand "npm" $args } function pip { - Invoke-WrappedCommand "pip" "aikido-pip" $args + Invoke-WrappedCommand "pip" $args } function pip3 { - Invoke-WrappedCommand "pip3" "aikido-pip3" $args + Invoke-WrappedCommand "pip3" $args } function uv { - Invoke-WrappedCommand "uv" "aikido-uv" $args + Invoke-WrappedCommand "uv" $args } # `python -m pip`, `python -m pip3`. function python { - Invoke-WrappedCommand 'python' 'aikido-python' $args + Invoke-WrappedCommand 'python' $args } # `python3 -m pip`, `python3 -m pip3'. function python3 { - Invoke-WrappedCommand 'python3' 'aikido-python3' $args + Invoke-WrappedCommand 'python3' $args } 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 29d6bf3..a72380f 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 @@ -17,41 +17,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,5 +65,5 @@ function npm end end - wrapSafeChainCommand "npm" "aikido-npm" $argv + wrapSafeChainCommand "npm" $argv end