Files
skillshare/.devcontainer/bin/ssnew
T
Willie c5d32111f7 dev: overhaul devcontainer experience with persistence and enhanced tooling
Improve the sandbox development environment to support "new user" simulation
while maintaining a high-quality developer experience.

Changes:
- Persistence: Redirect HOME to /home/developer and add a persistent volume
  to preserve shell history, gh auth state, and isolated environments.
- Tooling: Pre-install GitHub CLI (gh), air (hot-reload), and delve (dlv)
  in the sandbox Dockerfile.
- Isolated Envs:
    - Update ssenv to store environments in persistent $HOME/.ss-envs.
    - Add --init flag to ssnew/ssenv to auto-run 'ss init -g' in new envs.
    - Add visual PS1 indicator when an isolated environment is active.
- DX Refinements:
    - Add a centralized 'help' command (aliased to override bash built-in).
    - Fix ANSI color rendering in help script.
    - Robust PROJECT_ROOT redirection in skillshare wrapper script.
    - Support /home/developer in setup.sh environment checks.
2026-02-25 07:02:54 +08:00

25 lines
471 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
name=""
init_flag=""
while [[ $# -gt 0 ]]; do
case "$1" in
--init) init_flag="--init" ;;
--) shift; break ;;
-*) echo "Unknown option: $1" >&2; exit 1 ;;
*) if [ -z "$name" ]; then name="$1"; else break; fi ;;
esac
shift
done
if [ -z "$name" ]; then
name="env-$(date +%Y%m%d-%H%M%S)"
fi
ssenv create "$name" $init_flag
if [ "$#" -gt 0 ]; then
exec ssenv enter "$name" -- "$@"
fi
exec ssenv enter "$name"