Skip to content

Commit 8b54b3a

Browse files
committed
Added output signal tracking to the function trap.Improved code appearance.
1 parent bb22bd4 commit 8b54b3a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

aut-apps.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ if [[ $EUID -ne 0 ]]; then
44
exit 1
55
fi
66
function t-d-uninstaller {
7-
rm -rf $tmp_dir
8-
echo "Temporary directory uninstalled"
9-
exit 1
7+
rm -rf $tmp_dir
8+
echo "Temporary directory uninstalled"
9+
exit 1
1010
}
1111
tmp_dir=$(mktemp -d -t pub_key-XXXXXX)
12-
trap t-d-uninstaller SIGINT SIGTERM
12+
trap t-d-uninstaller SIGINT SIGTERM EXIT QUIT
13+
set -euo pipefail
1314
echo $tmp_dir
1415
echo 'deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main'>/etc/apt/sources.list.d/google-chrome.list
1516
echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list
@@ -18,5 +19,4 @@ curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > $
1819
install -o root -g root -m 644 $tmp_dir/microsoft.gpg /etc/apt/trusted.gpg.d/
1920
apt update
2021
echo 'Start install'
21-
apt-get -y install google-chrome-stable git apt-transport-https code
22-
t-d-uninstaller
22+
apt-get -y install google-chrome-stable git apt-transport-https code

0 commit comments

Comments
 (0)