2023-12-17 07:58:52 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
|
|
echo "Please run as root" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
build_dir="bin/linux"
|
|
|
|
out_dir="bin/package/linux"
|
2023-12-25 04:50:39 +08:00
|
|
|
script_dir=$( cd -- "$( dirname -- "${0}" )" &> /dev/null && pwd )
|
2023-12-17 07:58:52 +08:00
|
|
|
|
|
|
|
[[ -d "$script_dir/$build_dir" ]] || {
|
|
|
|
echo "[X] build folder wasn't found" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
apt update || exit 1
|
|
|
|
apt install tar -y || exit 1
|
|
|
|
|
|
|
|
mkdir -p "$script_dir/$out_dir"
|
|
|
|
|
2024-03-02 22:32:51 +08:00
|
|
|
archive_file="$script_dir/$out_dir/generate_emu_config-linux.tar.bz2"
|
2023-12-17 07:58:52 +08:00
|
|
|
[[ -f "$archive_file" ]] && rm -f "$archive_file"
|
2024-02-24 20:58:58 +08:00
|
|
|
|
|
|
|
pushd "$script_dir/$build_dir"
|
|
|
|
tar -c -j -vf "$archive_file" $(ls -d */)
|
|
|
|
popd
|