-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_zeeapp.sh
More file actions
executable file
·33 lines (27 loc) · 1.11 KB
/
Copy pathlaunch_zeeapp.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Wrapper to launch the published ZeeAppManager binary
# Adjust PUB_DIR if you moved the publish output
#!/bin/bash
# Wrapper to launch the published ZeeAppManager binary from any working directory.
# It resolves the script's directory and uses the publish folder relative to it.
set -e
# Resolve the directory this script lives in (works when symlinked)
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)"
# Publish directory relative to the script directory
PUB_DIR="$SCRIPT_DIR/bin/Release/net8.0/linux-x64/publish"
BINARY="$PUB_DIR/ZeeAppManager"
if [ ! -f "$BINARY" ]; then
echo "Published binary not found at: $BINARY" >&2
echo "Make sure you ran: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true" >&2
exit 2
fi
if [ ! -x "$BINARY" ]; then
chmod +x "$BINARY" 2>/dev/null || true
fi
exec "$BINARY" "$@"