mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-01-29 05:49:02 +00:00
Dependency check. Remove tmp_dir on exit.
This commit is contained in:
parent
35fd12b672
commit
62477143f2
@ -38,6 +38,12 @@
|
||||
# Contributor: https://github.com/Termuellinator
|
||||
############################################################################
|
||||
|
||||
# Check for dependencies
|
||||
if [ ! -x "$(command -v mktemp2)" ] || [ ! -x "$(command -v basename)" ]; then
|
||||
echo -e "One or more required packages were not found on this system.\nPlease check that the following packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wine_conf="winedir.conf"
|
||||
game_conf="gamedir.conf"
|
||||
backup_conf="backupdir.conf"
|
||||
@ -57,7 +63,9 @@ fi
|
||||
# .config subdirectory
|
||||
conf_subdir="starcitizen-lug"
|
||||
|
||||
tmp_dir="$(mktemp -d --suffix=".lughelper" || echo "/tmp")"
|
||||
# Temporary directory
|
||||
tmp_dir="$(mktemp -d --suffix=".lughelper")"
|
||||
trap 'rm -r "$tmp_dir"' EXIT
|
||||
|
||||
# The game's user subdirectory name
|
||||
user_subdir_name="USER"
|
||||
|
Loading…
x
Reference in New Issue
Block a user