mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
WIP
This commit is contained in:
parent
fa4c46c23d
commit
f400c5576a
12 changed files with 59 additions and 213 deletions
|
|
@ -97,27 +97,11 @@ function pip3 {
|
|||
|
||||
# `python -m pip`, `python -m pip3`.
|
||||
function python {
|
||||
param([Parameter(ValueFromRemainingArguments=$true)]$Args)
|
||||
if ($Args.Length -ge 2 -and $Args[0] -eq '-m' -and $Args[1] -match '^pip(3)?$') {
|
||||
$pipArgs = if ($Args.Length -gt 2) { $Args | Select-Object -Skip 2 } else { @() }
|
||||
if ($Args[1] -eq 'pip3') { Invoke-WrappedCommand 'pip3' 'aikido-pip3' $pipArgs }
|
||||
else { Invoke-WrappedCommand 'pip' 'aikido-pip' $pipArgs }
|
||||
}
|
||||
else {
|
||||
Invoke-RealCommand 'python' $Args
|
||||
}
|
||||
Invoke-WrappedCommand 'python' 'aikido-python' $args
|
||||
}
|
||||
|
||||
# `python3 -m pip`, `python3 -m pip3'.
|
||||
function python3 {
|
||||
param([Parameter(ValueFromRemainingArguments=$true)]$Args)
|
||||
if ($Args.Length -ge 2 -and $Args[0] -eq '-m' -and $Args[1] -match '^pip(3)?$') {
|
||||
# python3 always uses pip3, regardless of whether user types `pip` or `pip3`
|
||||
$pipArgs = if ($Args.Length -gt 2) { $Args | Select-Object -Skip 2 } else { @() }
|
||||
Invoke-WrappedCommand 'pip3' 'aikido-pip3' $pipArgs
|
||||
}
|
||||
else {
|
||||
Invoke-RealCommand 'python3' $Args
|
||||
}
|
||||
Invoke-WrappedCommand 'python3' 'aikido-python3' $args
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue