mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
refactor: boot scipt
This commit is contained in:
parent
743334a68a
commit
b21fbad8a3
@ -1,4 +1,21 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
|
||||
export ELECTRON_RUN_AS_NODE=1
|
||||
/opt/QQ/qq ${SCRIPT_DIR}/napcat.cjs $@
|
||||
|
||||
get_script_dir() {
|
||||
local script_path="${1:-$0}"
|
||||
local script_dir
|
||||
script_path=$(readlink -f "$script_path")
|
||||
script_dir=$(dirname "$script_path")
|
||||
|
||||
echo "$script_dir"
|
||||
}
|
||||
|
||||
SCRIPT_DIR=$(get_script_dir)
|
||||
|
||||
ELECTRON_RUN_AS_NODE=1
|
||||
|
||||
if ! [ -x /opt/QQ/qq ]; then
|
||||
echo "Error: /opt/QQ/qq is not executable or does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/opt/QQ/qq "${SCRIPT_DIR}/napcat.cjs" "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user