docs: Update README and documentation for lxs multi-tool across Linux and Windows platforms.
This commit is contained in:
+21
-5
@@ -6,13 +6,29 @@
|
||||
# Date: 2025
|
||||
|
||||
# Load LXS common library (colors, separator, run_spinner, loggers)
|
||||
# Prefers the sibling ../lib/common.sh (repo checkout or installed layout) and
|
||||
# only hits the network when this script is run standalone via curl.
|
||||
LXS_RAW_BASE="${LXS_RAW_BASE:-https://git.hyko.cx/hykocx/lxs/raw/branch/main}"
|
||||
_lib=$(curl -fsSL "${LXS_RAW_BASE}/lib/common.sh") || { echo "Failed to fetch lib/common.sh" >&2; exit 1; }
|
||||
eval "$_lib"
|
||||
unset _lib
|
||||
LXS_RAW_PLATFORM_BASE="${LXS_RAW_PLATFORM_BASE:-${LXS_RAW_BASE}/linux}"
|
||||
_lxs_lib=""
|
||||
if [ -n "${BASH_SOURCE[0]:-}" ]; then
|
||||
_lxs_self=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null) \
|
||||
|| _lxs_self=$(realpath "${BASH_SOURCE[0]}" 2>/dev/null) \
|
||||
|| _lxs_self="${BASH_SOURCE[0]}"
|
||||
_lxs_lib="$(dirname "$_lxs_self")/../lib/common.sh"
|
||||
fi
|
||||
if [ -n "$_lxs_lib" ] && [ -r "$_lxs_lib" ]; then
|
||||
# shellcheck disable=SC1090,SC1091
|
||||
. "$_lxs_lib"
|
||||
else
|
||||
_lib=$(curl -fsSL "${LXS_RAW_PLATFORM_BASE}/lib/common.sh") || { echo "Failed to fetch lib/common.sh" >&2; exit 1; }
|
||||
eval "$_lib"
|
||||
unset _lib
|
||||
fi
|
||||
unset _lxs_lib _lxs_self
|
||||
|
||||
# Run a sibling app script. Prefers a file next to this script (installed
|
||||
# layout); falls back to downloading from LXS_RAW_BASE.
|
||||
# layout); falls back to downloading from LXS_RAW_PLATFORM_BASE.
|
||||
run_sibling() {
|
||||
local script_path=$1
|
||||
shift
|
||||
@@ -35,7 +51,7 @@ run_sibling() {
|
||||
local temp_file exit_code
|
||||
temp_file=$(mktemp "/tmp/lxs.${script_name%.*}.XXXXXX.sh")
|
||||
echo -e "${CYAN}[..] Fetching ${BOLD}${script_name}${NC}${CYAN}...${NC}"
|
||||
if curl -fsSL -H "Cache-Control: no-cache" -o "${temp_file}" "${LXS_RAW_BASE}/${script_path}"; then
|
||||
if curl -fsSL -H "Cache-Control: no-cache" -o "${temp_file}" "${LXS_RAW_PLATFORM_BASE}/${script_path}"; then
|
||||
echo -e "${GREEN}[OK] Payload acquired${NC}"
|
||||
chmod +x "${temp_file}"
|
||||
"${temp_file}" "$@"
|
||||
|
||||
Reference in New Issue
Block a user