add python version by hatch in pwsh

This commit is contained in:
A.C.Sukazyo Eyre 2024-04-02 12:24:41 +08:00
parent 50ef7e1b41
commit a6ae67ade6
Signed by: Eyre_S
GPG Key ID: C17CE40291207874

View File

@ -8,6 +8,8 @@
<# ================= <# =================
- user variable - user variable
#> #>
. "$HOME/OneDrive/sukazyo-pin/environment.ps1"
$ws = "S:\workspace" $ws = "S:\workspace"
$tests = "S:\__test" $tests = "S:\__test"
@ -26,6 +28,10 @@ function whereis {
Get-Command $args | Format-List Get-Command $args | Format-List
} }
function dos2unix { & "C:/Program Files/Git/usr/bin/dos2unix" $args }
function unix2dos { & "C:/Program Files/Git/usr/bin/unix2dos" $args }
<# == batcat == #> <# == batcat == #>
Set-Alias -Name cat -Value bat Set-Alias -Name cat -Value bat
@ -200,6 +206,22 @@ Set-Alias -Name cdi -Value zi
# Import-Module "$ChocolateyProfile" # Import-Module "$ChocolateyProfile"
# } # }
<# === Python Versions managered by hatch === #>
$pythons = "$HOME/AppData/Local/hatch/pythons"
function pys () {
$version, $args_pass = $args
$py_path = "$pythons/$version/python"
echo "using Python version : $version"
echo "using Python path : $py_path"
& "$py_path/python.exe" $args_pass
}
function pysm () {
hatch python $args
}
<# === Oh-My-Posh === #> <# === Oh-My-Posh === #>
# $USE_POSH_THEME = "catppuccin" # $USE_POSH_THEME = "catppuccin"