fixed #9, fixed #7
Some checks failed
/ Lint Check Shellscripts (push) Failing after 5s

This commit is contained in:
2026-03-10 00:23:56 +05:30
parent 601cd2c7cd
commit e2c518c913

21
penv
View File

@@ -7,7 +7,7 @@
# Issues: # Issues:
# when uninstalling, remove any jupyter specs. iterate through envs in .env, call jspec remove name. # when uninstalling, remove any jupyter specs. iterate through envs in .env, call jspec remove name.
VERSION=1 VERSION=2
usage() { usage() {
@@ -131,7 +131,12 @@ list(){
echo "PENV not initialized. Run \"penv init\"" echo "PENV not initialized. Run \"penv init\""
exit 8 exit 8
fi fi
ls "$HOME"/.envs arr=$(ls "$HOME"/.envs)
str=""
for i in ${arr[@]}; do
str+="${i}_Py $("$HOME"/.envs/"$i"/bin/python -V | cut -d " " -f 2 | cut -d "." -f 1-2 )\n"
done
printf "$str" | column -t -N "Name,Version" -s "_"
} }
install() { install() {
@@ -140,7 +145,7 @@ install() {
exit 10 exit 10
fi fi
mkdir -p "$HOME/.local/bin" mkdir -p "$HOME/.local/bin"
cp $(realpath "$0") "$HOME"/.local/bin/ cp -T $(realpath "$0") "$HOME"/.local/bin/penv
mkdir -p "$HOME"/.envs/ mkdir -p "$HOME"/.envs/
echo " echo "
pact () { pact () {
@@ -215,15 +220,17 @@ update(){
fi fi
if [ -x "$(command -v curl)" ]; then if [ -x "$(command -v curl)" ]; then
curl "https://git.pvnweb.dedyn.io/phanipavank/jbomb/raw/branch/master/penv" -o "$HOME/.local/bin/penv" curl "https://git.pvnweb.dedyn.io/phanipavank/jbomb/raw/branch/master/penv" -o "$HOME/.local/bin/penv.temp"
elif [ -x "$(command -v wget)" ]; then elif [ -x "$(command -v wget)" ]; then
wget -o "$HOME/.local/bin/penv" "https://git.pvnweb.dedyn.io/phanipavank/jbomb/raw/branch/master/penv" wget -o "$HOME/.local/bin/penv.temp" "https://git.pvnweb.dedyn.io/phanipavank/jbomb/raw/branch/master/penv"
else else
echo Curl or wget not found. Install either one to update penv. echo Curl or wget not found. Install either one to update penv.
fi fi
chmod +x "$HOME/.local/bin/penv" chmod +x "$HOME/.local/bin/penv.temp"
"$HOME/.local/bin/penv.temp" install
rm "$HOME/.local/bin/penv.temp"
sleep 0.5 sleep 0.5
newVer=$(grep VERSION "$HOME/.local/bin/penv" | cut -d '=' -f 2) newVer=$(grep ^VERSION= "$HOME/.local/bin/penv" | cut -d '=' -f 2)
echo "PENV updated from $VERSION to $newVer" echo "PENV updated from $VERSION to $newVer"
exit 0 exit 0
} }