diff --git a/profiles/linux-dev/workstation-v0/bin/install-sourceos-cli.sh b/profiles/linux-dev/workstation-v0/bin/install-sourceos-cli.sh new file mode 100644 index 0000000..709fd5d --- /dev/null +++ b/profiles/linux-dev/workstation-v0/bin/install-sourceos-cli.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Install the profile-local `sourceos` helper CLI to user scope. +# Target: ~/.local/bin/sourceos + +PROFILE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +SRC="$PROFILE_DIR/bin/sourceos" +DEST_DIR="${HOME}/.local/bin" +DEST="$DEST_DIR/sourceos" + +info(){ printf "INFO: %s\n" "$*" >&2; } +warn(){ printf "WARN: %s\n" "$*" >&2; } +err(){ printf "ERROR: %s\n" "$*" >&2; } + +main(){ + [[ -x "$SRC" ]] || { err "sourceos helper missing: $SRC"; exit 2; } + + mkdir -p "$DEST_DIR" + cp -f "$SRC" "$DEST" + chmod +x "$DEST" + + info "installed: $DEST" + + if [[ ":$PATH:" != *":$DEST_DIR:"* ]]; then + warn "~/.local/bin is not on PATH. Add one line to your shell rc:" + warn " export PATH=\"$DEST_DIR:\$PATH\"" + fi +} + +main "$@" diff --git a/profiles/linux-dev/workstation-v0/bin/sourceos b/profiles/linux-dev/workstation-v0/bin/sourceos new file mode 100644 index 0000000..0716156 --- /dev/null +++ b/profiles/linux-dev/workstation-v0/bin/sourceos @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +set -euo pipefail + +# SourceOS workstation helper (linux-dev/workstation-v0) +# This is a small, dependency-light command surface intended to be callable from Albert. + +PROFILE_DIR_DEFAULT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +PROFILE_DIR="${SOURCEOS_PROFILE_DIR:-$PROFILE_DIR_DEFAULT}" + +err(){ printf "ERROR: %s\n" "$*" >&2; } +info(){ printf "INFO: %s\n" "$*" >&2; } + +usage(){ + cat <