Skip to content

Commit ea80098

Browse files
committed
The trap command is called after the function's appearance, the set command is raised up by the code.
1 parent 948ff82 commit ea80098

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aut-apps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env bash
2-
trap t-d-uninstaller SIGINT SIGTERM EXIT QUIT
2+
set -euo pipefail
33
if [[ $EUID -ne 0 ]]; then
44
echo "This script must be run as root" 1>&2
55
exit 1
@@ -8,8 +8,8 @@ function t-d-uninstaller {
88
rm -rf $tmp_dir
99
echo "Temporary directory uninstalled"
1010
}
11+
trap t-d-uninstaller SIGINT SIGTERM EXIT QUIT
1112
tmp_dir=$(mktemp -d -t pub_key-XXXXXX)
12-
set -euo pipefail
1313
echo $tmp_dir
1414
echo 'deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main'>/etc/apt/sources.list.d/google-chrome.list
1515
echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list

0 commit comments

Comments
 (0)