mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-23 19:25:35 +08:00
in Linux packaging script check for root priviledge after checking for input arg
This commit is contained in:
parent
5d0fef7110
commit
b568153772
@ -1,11 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Please run as root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build_base_dir="build/linux"
|
||||
out_dir="build/linux/package"
|
||||
script_dir=$( cd -- "$( dirname -- "${0}" )" &> /dev/null && pwd )
|
||||
@ -15,6 +10,11 @@ script_dir=$( cd -- "$( dirname -- "${0}" )" &> /dev/null && pwd )
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Please run as root" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ -d "$script_dir/$build_base_dir/$1" ]] || {
|
||||
echo "[X] build folder wasn't found";
|
||||
exit 1;
|
||||
|
Loading…
Reference in New Issue
Block a user