This commit is contained in:
Joakim
2026-10-17 16:40:15 +02:00
parent c48f65ac75
commit a9b30e68a6

View File

@@ -1,103 +1,133 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Installs the binary built by build.sh over whatever 'joe' currently
# resolves to, installs Python dependencies into a venv, and links
# hdc/hd-joe onto PATH.
#
# The compiled joe binary is copied out of the source/build tree into
# ~/.local/lib/hedgedoc-joe (or PREFIX_LIB if overridden), so the
# installation does not depend on the build directory remaining present.
#
# Usage: ./install.sh [--joe-target PATH] [--bin-dir DIR]
# ./install.sh --restore [--joe-target PATH] [--bin-dir DIR]
# sudo ./install.sh --joe-only [--joe-target PATH]
#
# --joe-target PATH Where to install patched joe (default: wherever
# 'joe' currently resolves on PATH, or
# <bin-dir>/joe if there isn't one yet).
# --bin-dir DIR Where to install hdc and hd-joe (default: ~/.local/bin).
# --joe-only Only back up + install the joe binary; skip the
# venv/pip/launcher setup entirely. Use this (with
# sudo, if needed) when the joe target directory
# (e.g. /usr/local/bin) isn't writable by you --
# run the plain form (no sudo) separately for
# everything else.
# --restore Undo: put the original joe back from its backup,
# remove the hdc/hd-joe launchers, disable and remove
# the sync service, and remove the installed patched
# joe copy.
# --notes-dir DIR What the sync service watches (default: ~/notes,
# same default hdc itself uses).
# --sync-interval N Seconds between polls for the sync service
# (default: 30).
# --no-service Skip setting up the continuous background sync
# service entirely -- run `hdc sync --watch`
# yourself if you'd rather manage that some other
# way (cron, a different init system, by hand).
#
# NEVER run the plain form (no --joe-only) with sudo: it sets up a venv and
# launcher scripts meant for YOUR account, and running the whole thing as
# root creates them owned by root, under root's $HOME, invisible to you
# afterward. If joe's install location needs root, use --joe-only for just
# that part (with sudo) and run the rest as yourself.
set -euo pipefail set -euo pipefail
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
BUILT="$SCRIPT_DIR/joe-patch/build/joe-4.8/joe/joe"
# ============================================================================
# Installation paths
#
# Source tree:
# $SCRIPT_DIR
#
# Installed files:
# ~/.local/bin/
# ~/.local/lib/hedgedoc-joe/
#
# Nothing runtime-critical is left in the source tree.
# ============================================================================
BIN_DIR="${BIN_DIR:-$HOME/.local/bin}" BIN_DIR="${BIN_DIR:-$HOME/.local/bin}"
PREFIX_LIB="${PREFIX_LIB:-$HOME/.local/lib/hedgedoc-joe}" INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/lib/hedgedoc-joe}"
INSTALLED_JOE="$PREFIX_LIB/joe"
INSTALLED_JOE="$INSTALL_DIR/joe"
INSTALLED_HDC="$INSTALL_DIR/hd-cli"
INSTALLED_HD_JOE="$INSTALL_DIR/hd-joe"
VENV_DIR="$INSTALL_DIR/venv"
JOE_WRAPPER="$BIN_DIR/joe"
HDC_WRAPPER="$BIN_DIR/hdc"
HD_JOE_WRAPPER="$BIN_DIR/hd-joe"
BUILT="$SCRIPT_DIR/joe-patch/build/joe-4.8/joe/joe"
NOTES_DIR="${NOTES_DIR:-$HOME/notes}" NOTES_DIR="${NOTES_DIR:-$HOME/notes}"
SYNC_INTERVAL="${SYNC_INTERVAL:-30}" SYNC_INTERVAL="${SYNC_INTERVAL:-30}"
# Defined here, unconditionally, not inside install_python_and_launchers():
# install_joe() (possibly run alone, under sudo, via --joe-only, before the
# venv exists yet) needs this path too, to write it into the joe wrapper.
VENV_DIR="$SCRIPT_DIR/.venv"
JOE_TARGET=""
RESTORE=0
JOE_ONLY=0
NO_SERVICE=0
SERVICE_NAME="hdc-sync.service" SERVICE_NAME="hdc-sync.service"
SERVICE_PATH="$HOME/.config/systemd/user/$SERVICE_NAME" SERVICE_PATH="$HOME/.config/systemd/user/$SERVICE_NAME"
RESTORE=0
NO_SERVICE=0
# ============================================================================
# Arguments
# ============================================================================
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
--restore) --restore)
RESTORE=1 RESTORE=1
shift shift
;; ;;
--joe-only)
JOE_ONLY=1
shift
;;
--no-service) --no-service)
NO_SERVICE=1 NO_SERVICE=1
shift shift
;; ;;
--joe-target)
JOE_TARGET="$2"
shift 2
;;
--bin-dir) --bin-dir)
BIN_DIR="$2" BIN_DIR="$2"
JOE_WRAPPER="$BIN_DIR/joe"
HDC_WRAPPER="$BIN_DIR/hdc"
HD_JOE_WRAPPER="$BIN_DIR/hd-joe"
shift 2 shift 2
;; ;;
--install-dir)
INSTALL_DIR="$2"
INSTALLED_JOE="$INSTALL_DIR/joe"
INSTALLED_HDC="$INSTALL_DIR/hd-cli"
INSTALLED_HD_JOE="$INSTALL_DIR/hd-joe"
VENV_DIR="$INSTALL_DIR/venv"
shift 2
;;
--notes-dir) --notes-dir)
NOTES_DIR="$2" NOTES_DIR="$2"
shift 2 shift 2
;; ;;
--sync-interval) --sync-interval)
SYNC_INTERVAL="$2" SYNC_INTERVAL="$2"
shift 2 shift 2
;; ;;
-h|--help) -h|--help)
sed -n '2,44p' "$0" | sed 's/^# \{0,1\}//' cat <<EOF
Usage: $0 [OPTIONS]
Install:
$0
Options:
--bin-dir DIR
User executable directory.
Default: ~/.local/bin
--install-dir DIR
Permanent installation directory.
Default: ~/.local/lib/hedgedoc-joe
--notes-dir DIR
Notes directory for the sync service.
Default: ~/notes
--sync-interval N
Sync interval in seconds.
Default: 30
--no-service
Do not install the user systemd service.
--restore
Remove the user-local installation.
-h, --help
Show this help.
No sudo is required.
The system installation of joe is never modified.
EOF
exit 0 exit 0
;; ;;
*) *)
echo "Unknown argument: $1" >&2 echo "Unknown argument: $1" >&2
exit 1 exit 1
@@ -105,156 +135,271 @@ while [ $# -gt 0 ]; do
esac esac
done done
if [ -z "$JOE_TARGET" ]; then
JOE_TARGET="$(command -v joe 2>/dev/null || true)" # ============================================================================
[ -z "$JOE_TARGET" ] && JOE_TARGET="$BIN_DIR/joe" # Never run as root
# ============================================================================
if [ "$(id -u)" = "0" ]; then
echo "ERROR: Do not run install.sh with sudo." >&2
echo "This is a per-user installation." >&2
exit 1
fi fi
BACKUP="${JOE_TARGET}.pre-hedgedoc"
install_joe() { # ============================================================================
if [ ! -x "$BUILT" ]; then # Restore
echo "$BUILT not found -- run ./build.sh first." >&2 # ============================================================================
exit 1
restore() {
echo "==> Removing HedgeDoc JOE installation"
# Stop/remove user service first.
if command -v systemctl >/dev/null 2>&1; then
systemctl --user disable --now "$SERVICE_NAME" \
>/dev/null 2>&1 || true
rm -f "$SERVICE_PATH"
systemctl --user daemon-reload \
>/dev/null 2>&1 || true
fi fi
echo "==> Installing compiled joe to $INSTALLED_JOE" # Remove our launchers only if they are ours.
for launcher in \
mkdir -p "$PREFIX_LIB" "$JOE_WRAPPER" \
"$HDC_WRAPPER" \
if ! cp "$BUILT" "$INSTALLED_JOE"; then "$HD_JOE_WRAPPER"
echo "Could not install $BUILT -> $INSTALLED_JOE" >&2 do
return 1 if [ -f "$launcher" ] &&
fi grep -q '# hedgedoc-joe-installer' "$launcher" 2>/dev/null
chmod 755 "$INSTALLED_JOE"
echo "==> Installed patched joe binary: $INSTALLED_JOE"
mkdir -p "$(dirname "$JOE_TARGET")" 2>/dev/null || true
# Back up whatever ORIGINAL, non-hd joe was at this path -- once.
# If what's there is already one of our own wrappers, there's nothing
# genuine left to preserve.
if [ -e "$JOE_TARGET" ] &&
! grep -q "# hd-installer-generated" "$JOE_TARGET" 2>/dev/null; then
if [ -e "$BACKUP" ]; then
echo "==> Backup already exists at $BACKUP (leaving it -- it's your original, pre-hd, joe)"
else
if ! cp "$JOE_TARGET" "$BACKUP" 2>/dev/null; then
echo "$(dirname "$JOE_TARGET") isn't writable by $(whoami) -- can't back up the existing joe there." >&2
echo "Run just this part with sudo:" >&2
echo " sudo $0 --joe-only --joe-target $JOE_TARGET" >&2
echo "then run $0 again WITHOUT sudo to finish (venv, hdc, hd-joe)." >&2
return 1
fi
echo "==> Backed up existing joe: $JOE_TARGET -> $BACKUP"
fi
fi
if [ ! -w "$(dirname "$JOE_TARGET")" ]; then
echo "$(dirname "$JOE_TARGET") isn't writable by $(whoami)." >&2
echo "Run just this part with sudo:" >&2
echo " sudo $0 --joe-only --joe-target $JOE_TARGET" >&2
echo "then run $0 again WITHOUT sudo to finish (venv, hdc, hd-joe)." >&2
return 1
fi
# joe itself is now a wrapper, not the raw binary:
# - HedgeDoc-managed notes are routed to hd-joe.
# - Everything else is handled by the installed patched joe binary.
#
# The compiled binary lives at $INSTALLED_JOE, outside the source tree.
if ! cat > "$JOE_TARGET" <<WRAPEOF 2>/dev/null
#!/usr/bin/env bash
# hd-installer-generated
exec "$VENV_DIR/bin/python3" "$SCRIPT_DIR/hd-joe/joe_wrapper.py" "\$@"
WRAPEOF
then then
echo "Could not write $JOE_TARGET (permission denied)." >&2 rm -f "$launcher"
echo " sudo $0 --joe-only --joe-target $JOE_TARGET" >&2 echo " Removed $launcher"
return 1 fi
done
# Remove complete installed application.
if [ -d "$INSTALL_DIR" ]; then
rm -rf "$INSTALL_DIR"
echo " Removed $INSTALL_DIR"
fi fi
chmod 755 "$JOE_TARGET" echo
echo "==> Restore complete"
echo "==> Installed joe wrapper -> $JOE_TARGET" echo
echo " Patched joe binary -> $INSTALLED_JOE" echo "The system joe was never modified."
echo " Source/build tree can now be removed independently."
return 0
} }
install_python_and_launchers() {
if [ "$(id -u)" = "0" ]; then if [ "$RESTORE" = 1 ]; then
echo "Refusing to set up the venv and hdc/hd-joe launchers as root." >&2 restore
echo "This part is meant to run as your own user -- re-run without sudo." >&2 exit 0
echo "(If joe's install location needs root, use --joe-only with sudo" >&2 fi
echo " for that part separately.)" >&2
# ============================================================================
# Verify source tree
# ============================================================================
if [ ! -x "$BUILT" ]; then
echo "ERROR: Patched joe binary not found:"
echo
echo " $BUILT"
echo
echo "Run ./build.sh first."
exit 1 exit 1
fi fi
echo "==> Setting up a virtual environment at $VENV_DIR" if [ ! -f "$SCRIPT_DIR/hd-joe/joe_wrapper.py" ]; then
echo "ERROR: hd-joe source not found:"
echo " $SCRIPT_DIR/hd-joe"
exit 1
fi
python3 -m venv "$VENV_DIR" if [ ! -f "$SCRIPT_DIR/hd-joe/requirements.txt" ]; then
echo "ERROR: hd-joe requirements not found."
exit 1
fi
"$VENV_DIR/bin/pip" install --quiet --upgrade pip if [ ! -f "$SCRIPT_DIR/hd-cli/requirements.txt" ]; then
echo "ERROR: hd-cli requirements not found."
exit 1
fi
"$VENV_DIR/bin/pip" install \
-r "$SCRIPT_DIR/hd-cli/requirements.txt" \
-r "$SCRIPT_DIR/hd-joe/requirements.txt"
echo "==> Installing launchers into $BIN_DIR" # ============================================================================
# Display installation
# ============================================================================
mkdir -p "$BIN_DIR" echo
echo "=============================================="
echo " HedgeDoc JOE user installation"
echo "=============================================="
echo
echo "Source:"
echo " $SCRIPT_DIR"
echo
echo "Installation:"
echo " $INSTALL_DIR"
echo
echo "Executables:"
echo " $JOE_WRAPPER"
echo " $HDC_WRAPPER"
echo " $HD_JOE_WRAPPER"
echo
cat > "$BIN_DIR/hdc" <<WRAPEOF
# ============================================================================
# Create installation directory
# ============================================================================
echo "==> Creating installation directory"
mkdir -p "$INSTALL_DIR"
mkdir -p "$BIN_DIR"
# ============================================================================
# Install patched JOE
# ============================================================================
echo "==> Installing patched joe"
cp "$BUILT" "$INSTALLED_JOE"
chmod 755 "$INSTALLED_JOE"
echo " $INSTALLED_JOE"
# ============================================================================
# Install Python applications
#
# Copy the source code into the permanent installation directory.
# After this point the runtime does NOT depend on SCRIPT_DIR.
# ============================================================================
echo "==> Installing Python applications"
rm -rf "$INSTALLED_HDC"
rm -rf "$INSTALLED_HD_JOE"
cp -a "$SCRIPT_DIR/hd-cli" "$INSTALLED_HDC"
cp -a "$SCRIPT_DIR/hd-joe" "$INSTALLED_HD_JOE"
# ============================================================================
# Python virtual environment
# ============================================================================
echo "==> Creating Python virtual environment"
rm -rf "$VENV_DIR"
python3 -m venv "$VENV_DIR"
echo "==> Installing Python dependencies"
"$VENV_DIR/bin/python3" -m pip install \
--quiet \
--upgrade pip
"$VENV_DIR/bin/python3" -m pip install \
-r "$INSTALLED_HDC/requirements.txt" \
-r "$INSTALLED_HD_JOE/requirements.txt"
# ============================================================================
# joe wrapper
#
# This wrapper contains ONLY permanent installation paths.
# It does not reference SCRIPT_DIR.
# ============================================================================
echo "==> Installing joe wrapper"
cat > "$JOE_WRAPPER" <<EOF
#!/usr/bin/env bash #!/usr/bin/env bash
# hd-installer-generated # hedgedoc-joe-installer
exec "$VENV_DIR/bin/python3" "$SCRIPT_DIR/hd-cli/hdc" "\$@"
WRAPEOF
cat > "$BIN_DIR/hd-joe" <<WRAPEOF exec "$VENV_DIR/bin/python3" \
"$INSTALLED_HD_JOE/joe_wrapper.py" "\$@"
EOF
chmod 755 "$JOE_WRAPPER"
# ============================================================================
# hdc launcher
# ============================================================================
echo "==> Installing hdc"
cat > "$HDC_WRAPPER" <<EOF
#!/usr/bin/env bash #!/usr/bin/env bash
# hd-installer-generated # hedgedoc-joe-installer
exec "$VENV_DIR/bin/python3" "$SCRIPT_DIR/hd-joe/hd_joe_agent.py" "\$@"
WRAPEOF
chmod +x "$BIN_DIR/hdc" "$BIN_DIR/hd-joe" exec "$VENV_DIR/bin/python3" \
"$INSTALLED_HDC/hdc" "\$@"
EOF
case ":$PATH:" in chmod 755 "$HDC_WRAPPER"
# ============================================================================
# hd-joe launcher
# ============================================================================
echo "==> Installing hd-joe"
cat > "$HD_JOE_WRAPPER" <<EOF
#!/usr/bin/env bash
# hedgedoc-joe-installer
exec "$VENV_DIR/bin/python3" \
"$INSTALLED_HD_JOE/hd_joe_agent.py" "\$@"
EOF
chmod 755 "$HD_JOE_WRAPPER"
# ============================================================================
# PATH information
# ============================================================================
case ":$PATH:" in
*":$BIN_DIR:"*) *":$BIN_DIR:"*)
;; ;;
*) *)
echo echo
echo "NOTE: $BIN_DIR isn't on your PATH. Add to your shell rc:" echo "NOTE: $BIN_DIR is not currently in PATH."
echo " export PATH=\"$BIN_DIR:\$PATH\""
;;
esac
echo echo
echo " hdc -> $BIN_DIR/hdc (runs via $VENV_DIR)" echo "Add this to your shell configuration:"
echo " hd-joe -> $BIN_DIR/hd-joe (runs via $VENV_DIR)" echo
} echo " export PATH=\"$BIN_DIR:\$PATH\""
echo
;;
esac
# ============================================================================
# User systemd service
# ============================================================================
install_sync_service() { install_sync_service() {
if [ "$(id -u)" = "0" ]; then
echo "Refusing to set up the sync service as root -- re-run without sudo." >&2
return 1
fi
if ! command -v systemctl >/dev/null 2>&1; then if ! command -v systemctl >/dev/null 2>&1; then
echo "==> systemctl not found -- skipping the background sync service." echo "==> systemctl not found -- skipping sync service."
echo " Run 'hdc sync --dir $NOTES_DIR --watch' yourself (or via cron/tmux/screen)"
echo " to get continuous sync instead of running 'hdc sync' by hand each time."
return 0 return 0
fi fi
mkdir -p "$(dirname "$SERVICE_PATH")" mkdir -p "$(dirname "$SERVICE_PATH")"
cat > "$SERVICE_PATH" <<UNITEOF cat > "$SERVICE_PATH" <<EOF
[Unit] [Unit]
Description=hdc sync --watch -- continuous HedgeDoc <-> local folder sync Description=hdc sync --watch -- continuous HedgeDoc local folder sync
After=network-online.target After=network-online.target
Wants=network-online.target Wants=network-online.target
StartLimitIntervalSec=300 StartLimitIntervalSec=300
@@ -262,122 +407,134 @@ StartLimitBurst=10
[Service] [Service]
Type=simple Type=simple
ExecStart=$BIN_DIR/hdc sync --dir $NOTES_DIR --watch --interval $SYNC_INTERVAL ExecStart=$HDC_WRAPPER sync --dir $NOTES_DIR --watch --interval $SYNC_INTERVAL
Restart=on-failure Restart=on-failure
RestartSec=15 RestartSec=15
[Install] [Install]
WantedBy=default.target WantedBy=default.target
UNITEOF EOF
echo "==> Wrote $SERVICE_PATH" echo "==> Installed user systemd service:"
echo " $SERVICE_PATH"
if ! systemctl --user daemon-reload 2>/tmp/hdc-systemctl-err; then if ! systemctl --user daemon-reload 2>/dev/null; then
echo "==> Couldn't reach your systemd user session ($(cat /tmp/hdc-systemctl-err 2>/dev/null))." >&2 echo
echo " Common cause: no active login session (e.g. a bare SSH connection)." >&2 echo "NOTE: Could not contact the user systemd session."
echo " The unit file is in place at $SERVICE_PATH -- once you have a normal" >&2 echo "The service file was installed but not started."
echo " desktop/login session, run:" >&2 echo
echo " systemctl --user daemon-reload && systemctl --user enable --now $SERVICE_NAME" >&2 echo "Run later:"
rm -f /tmp/hdc-systemctl-err echo
echo " systemctl --user daemon-reload"
echo " systemctl --user enable --now $SERVICE_NAME"
return 0 return 0
fi fi
rm -f /tmp/hdc-systemctl-err systemctl --user enable "$SERVICE_NAME" \
>/dev/null 2>&1 || true
systemctl --user enable "$SERVICE_NAME" >/dev/null 2>&1
if [ -d "$NOTES_DIR/.hd" ]; then if [ -d "$NOTES_DIR/.hd" ]; then
systemctl --user restart "$SERVICE_NAME"
echo "==> $SERVICE_NAME enabled and running -- watching $NOTES_DIR every ${SYNC_INTERVAL}s" systemctl --user restart "$SERVICE_NAME" \
>/dev/null 2>&1 || \
systemctl --user start "$SERVICE_NAME" \
>/dev/null 2>&1 || true
echo "==> Sync service enabled"
echo " Notes: $NOTES_DIR"
echo " Interval: ${SYNC_INTERVAL}s"
else else
echo "==> $SERVICE_NAME enabled but NOT started -- $NOTES_DIR/.hd doesn't exist yet."
echo " Run 'hdc init <url> --dir $NOTES_DIR' first, then:" echo "==> Sync service installed but not started."
echo " systemctl --user start $SERVICE_NAME" echo " $NOTES_DIR/.hd does not exist yet."
fi fi
} }
# --- restore -------------------------------------------------------------
if [ "$RESTORE" = 1 ]; then
if [ -f "$BACKUP" ]; then
if cp "$BACKUP" "$JOE_TARGET" 2>/dev/null; then
echo "Restored: $BACKUP -> $JOE_TARGET"
else
echo "$JOE_TARGET isn't writable by $(whoami) -- run:" >&2
echo " sudo cp $BACKUP $JOE_TARGET" >&2
fi
else
echo "No backup at $BACKUP -- nothing to restore." >&2
fi
for name in hdc hd-joe; do
link="$BIN_DIR/$name"
if [ -f "$link" ] &&
grep -q "# hd-installer-generated" "$link" 2>/dev/null; then
rm "$link"
echo "Removed $link"
fi
done
if [ -f "$SERVICE_PATH" ] &&
command -v systemctl >/dev/null 2>&1; then
systemctl --user disable --now "$SERVICE_NAME" >/dev/null 2>&1 || true
rm -f "$SERVICE_PATH"
systemctl --user daemon-reload 2>/dev/null || true
echo "Disabled and removed $SERVICE_NAME"
fi
if [ -f "$INSTALLED_JOE" ]; then
rm -f "$INSTALLED_JOE"
echo "Removed installed patched joe: $INSTALLED_JOE"
fi
if [ -d "$PREFIX_LIB" ] && [ -z "$(ls -A "$PREFIX_LIB" 2>/dev/null)" ]; then
rmdir "$PREFIX_LIB"
fi
exit 0
fi
# --- joe-only ------------------------------------------------------------
if [ "$JOE_ONLY" = 1 ]; then
install_joe
exit $?
fi
# --- full install --------------------------------------------------------
install_python_and_launchers
if [ "$NO_SERVICE" = 1 ]; then if [ "$NO_SERVICE" = 1 ]; then
echo
echo "==> --no-service: skipping the background sync service." echo "==> --no-service: skipping systemd service"
else else
echo
echo "==> Installing user systemd service"
install_sync_service install_sync_service
fi fi
echo
JOE_OK=1 # ============================================================================
install_joe || JOE_OK=0 # Final verification
# ============================================================================
echo echo
echo "==> Verifying installation"
if [ "$JOE_OK" = 1 ]; then if [ ! -x "$INSTALLED_JOE" ]; then
echo "Done. joe at $JOE_TARGET has HedgeDoc support (only active when" echo "ERROR: Installed joe is missing."
echo "JOE_HEDGE_SOCKET is set -- stock behavior otherwise; your original" exit 1
echo "is backed up at $BACKUP)."
echo "Installed patched joe binary: $INSTALLED_JOE"
else
echo "hd and hd-joe are set up. Patched joe is NOT installed yet -- see"
echo "the sudo command printed above to finish that part."
fi fi
echo if [ ! -x "$JOE_WRAPPER" ]; then
echo "Restore the original joe, remove hdc/hd-joe, and stop the sync service: $0 --restore" echo "ERROR: joe launcher is missing."
exit 1
fi
if [ ! -x "$HDC_WRAPPER" ]; then
echo "ERROR: hdc launcher is missing."
exit 1
fi
if [ ! -x "$HD_JOE_WRAPPER" ]; then
echo "ERROR: hd-joe launcher is missing."
exit 1
fi
if [ ! -x "$VENV_DIR/bin/python3" ]; then
echo "ERROR: Python virtual environment is missing."
exit 1
fi
# ============================================================================
# Done
# ============================================================================
echo
echo "=============================================="
echo " Installation complete"
echo "=============================================="
echo
echo "Installed files:"
echo
echo " $INSTALL_DIR"
echo
echo "Commands:"
echo
echo " $JOE_WRAPPER"
echo " $HDC_WRAPPER"
echo " $HD_JOE_WRAPPER"
echo
echo "Patched JOE:"
echo
echo " $INSTALLED_JOE"
echo
echo "Python:"
echo
echo " $VENV_DIR"
echo
echo "The installation is independent of:"
echo
echo " $SCRIPT_DIR"
echo
echo "You can now remove the source directory."
echo
echo "System joe has NOT been modified."
echo
echo "To remove this installation later:"
echo
echo " $0 --restore"
echo