mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-02-27 20:53:01 +00:00
20 lines
333 B
Bash
Executable file
20 lines
333 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
require_cmd() {
|
|
local cmd="$1"
|
|
if ! command -v "${cmd}" >/dev/null 2>&1; then
|
|
echo "Error: ${cmd} is required but not installed."
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
script_dir() {
|
|
cd "$(dirname "${BASH_SOURCE[0]}")" && pwd
|
|
}
|
|
|
|
repo_root() {
|
|
local dir
|
|
dir="$(script_dir)"
|
|
cd "${dir}/.." && pwd
|
|
}
|