-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·43 lines (37 loc) · 1.47 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·43 lines (37 loc) · 1.47 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
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
# Mount dsh-client-ui-trajectory-plus into the 'web' dsh profile, replacing
# the official ui-trajectory plugin. Safe to run repeatedly.
set -euo pipefail
PROFILE_DIR="$HOME/.dsh/profiles/web"
PROFILE_NM="$PROFILE_DIR/node_modules"
PATCH_FILE="$PROFILE_DIR/cordis.patch.yml"
PACKAGE_DIR="$(cd "$(dirname "$0")" && pwd)"
PACKAGE_NAME="dsh-client-ui-trajectory-plus"
if [ ! -d "$PROFILE_DIR" ]; then
echo "error: profile dir not found: $PROFILE_DIR" >&2
exit 1
fi
# 1) symlink the package into the profile's node_modules (like other local plugins)
if [ -e "$PROFILE_NM/$PACKAGE_NAME" ] && [ ! -L "$PROFILE_NM/$PACKAGE_NAME" ]; then
echo "error: $PROFILE_NM/$PACKAGE_NAME exists and is not a symlink" >&2
exit 1
fi
ln -sfn "$PACKAGE_DIR" "$PROFILE_NM/$PACKAGE_NAME"
echo "linked $PROFILE_NM/$PACKAGE_NAME -> $PACKAGE_DIR"
# 2) patch cordis.patch.yml: disable official ui-trajectory, insert the fork
if ! grep -q "dsh-client-ui-trajectory-plus" "$PATCH_FILE"; then
cat >> "$PATCH_FILE" <<'YAML'
# --- dsh-webui-session+turn-location fork: replace the official trajectory panel ---
- id: ui-trajectory
disabled: true
- insert:
- id: ui-trajectory-plus
name: 'dsh-client-ui-trajectory-plus'
YAML
echo "patched $PATCH_FILE"
else
echo "$PATCH_FILE already patched"
fi
echo
echo "done. Restart 'dsh web' (or your profile's web server) for the change to take effect."
echo "Rollback: remove the two entries above from $PATCH_FILE, delete the symlink, and restart."