Manage workind directories using pushd/popd

This commit is contained in:
Manuel Thalmann 2023-01-23 16:14:55 +01:00
parent d6234bd7c9
commit 38b9812d97
8 changed files with 17 additions and 26 deletions
scripts/Software
JetBrains
Oh My Posh
Woodpecker CLI
tea

View file

@ -4,14 +4,13 @@ if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE";
else
workingDirectory="$(pwd)";
contextRoot="$(mktemp -d)";
cd "$contextRoot";
pushd "$contextRoot";
curl -fsSL https://raw.githubusercontent.com/nagygergo/jetbrains-toolbox-install/1.1/jetbrains-toolbox.sh \
| bash;
cd "$workingDirectory";
popd;
rm -rf "$contextRoot";
{

View file

@ -5,14 +5,13 @@ then
sudo bash "$BASH_SOURCE" "$USER";
else
bin=oh-my-posh;
workingDirectory="$(pwd)";
contextRoot="$(mktemp -d)";
cd "$contextRoot";
pushd "$contextRoot";
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O "$bin";
install "$bin" /usr/local/bin;
cd "$workingDirectory";
popd;
rm -rf "$contextRoot";
homeDir="$(sudo -u "$1" bash -c 'realpath ~')";

View file

@ -4,7 +4,6 @@ if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE";
else
workingDirectory="$(pwd)";
contextRoot="$(mktemp -d)";
cd "$contextRoot";
@ -19,6 +18,6 @@ else
tar -xvzf woodpecker-cli.tar.gz;
install woodpecker-cli /usr/local/bin;
cd "$workingDirectory";
popd;
rm -rf "$contextRoot";
fi

View file

@ -4,13 +4,12 @@ if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE";
else
workingDirectory="$(pwd)";
contextRoot="$(mktemp -d)";
cd "$contextRoot";
pushd "$contextRoot";
wget https://dl.gitea.io/tea/0.9.0/tea-0.9.0-linux-amd64 -O tea;
install tea /usr/local/bin;
cd "$workingDirectory";
popd;
rm -rf "$contextRoot";
fi