Clean up code

This commit is contained in:
Reinier Criel 2025-10-28 09:45:24 -07:00
parent 684edd27a2
commit ccd59a2f17
4 changed files with 0 additions and 4 deletions

View file

@ -82,7 +82,6 @@ function python
if test (count $argv) -ge 2; and test $argv[1] = "-m"; and string match -qr '^pip(3)?$' -- $argv[2] if test (count $argv) -ge 2; and test $argv[1] = "-m"; and string match -qr '^pip(3)?$' -- $argv[2]
set mod $argv[2] set mod $argv[2]
set args $argv[3..-1] set args $argv[3..-1]
# python -m pip → aikido-pip, python -m pip3 → aikido-pip3
if test $mod = "pip3" if test $mod = "pip3"
wrapSafeChainCommand "pip3" "aikido-pip3" $args wrapSafeChainCommand "pip3" "aikido-pip3" $args
else else

View file

@ -74,7 +74,6 @@ function python() {
if [[ "$1" == "-m" && "$2" == pip* ]]; then if [[ "$1" == "-m" && "$2" == pip* ]]; then
local mod="$2" local mod="$2"
shift 2 shift 2
# python -m pip → aikido-pip, python -m pip3 → aikido-pip3
if [[ "$mod" == "pip3" ]]; then if [[ "$mod" == "pip3" ]]; then
wrapSafeChainCommand "pip3" "aikido-pip3" "$@" wrapSafeChainCommand "pip3" "aikido-pip3" "$@"
else else

View file

@ -99,7 +99,6 @@ function pip3 {
function python { function python {
param([Parameter(ValueFromRemainingArguments=$true)]$Args) param([Parameter(ValueFromRemainingArguments=$true)]$Args)
if ($Args.Length -ge 2 -and $Args[0] -eq '-m' -and $Args[1] -match '^pip(3)?$') { if ($Args.Length -ge 2 -and $Args[0] -eq '-m' -and $Args[1] -match '^pip(3)?$') {
# python -m pip → aikido-pip, python -m pip3 → aikido-pip3
$pipArgs = if ($Args.Length -gt 2) { $Args | Select-Object -Skip 2 } else { @() } $pipArgs = if ($Args.Length -gt 2) { $Args | Select-Object -Skip 2 } else { @() }
if ($Args[1] -eq 'pip3') { Invoke-WrappedCommand 'pip3' 'aikido-pip3' $pipArgs } if ($Args[1] -eq 'pip3') { Invoke-WrappedCommand 'pip3' 'aikido-pip3' $pipArgs }
else { Invoke-WrappedCommand 'pip' 'aikido-pip' $pipArgs } else { Invoke-WrappedCommand 'pip' 'aikido-pip' $pipArgs }

View file

@ -115,7 +115,6 @@ export async function safeSpawnPy(command, args, options = {}) {
} }
return new Promise((resolve) => { return new Promise((resolve) => {
// On Unix/macOS resolve to full path to avoid PATH ambiguity; keep shell disabled everywhere
let cmdToRun = command; let cmdToRun = command;
if (os.platform() !== "win32") { if (os.platform() !== "win32") {
try { try {