-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·30 lines (26 loc) · 1.28 KB
/
install.sh
File metadata and controls
executable file
·30 lines (26 loc) · 1.28 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
#!/usr/bin/env bash
###############################################################################
# SENTINEL – Framework installer
# -----------------------------------------------
# Hardened edition • v2.4.0 • 2025-01-16
# Installs/repairs directly to user's home directory
# and patches the user's Bash startup chain in an idempotent way.
###############################################################################
# Detect if script is being sourced instead of executed
# This prevents the user's shell from being terminated if they incorrectly use 'source install.sh'
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
echo "Error: This script should be executed with 'bash install.sh', not sourced with 'source install.sh'." >&2
echo "Sourcing would cause your shell to exit if an error occurs." >&2
return 1
fi
# Set the project root
PROJECT_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
# Locate the installer entrypoint dynamically
INSTALLER_ENTRYPOINT="${PROJECT_ROOT}/installer/install.sh"
if [[ ! -x "${INSTALLER_ENTRYPOINT}" ]]; then
echo "Installer entrypoint not found: ${INSTALLER_ENTRYPOINT}" >&2
echo "Ensure the installer directory is intact before retrying." >&2
exit 1
fi
# Call the main installer script
bash "${INSTALLER_ENTRYPOINT}" "$@"