Skip to content

Commit 38cb7e8

Browse files
committed
Add ~/Work directory and seed devsetup clone
Create ~/Work at the end of setup and clone devsetup into it as a convenience for engineers who want to contribute. This does not affect how setup.sh runs — it still executes via curl|bash from GitHub. Provide GH_TOKEN in CI so gh auth and the clone step work.
1 parent 7fa4fac commit 38cb7e8

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
run: bash setup.sh
2727
env:
2828
CI: "true"
29+
GH_TOKEN: ${{ github.token }}
2930

3031
- name: Install bats
3132
run: sudo apt-get install -y -qq bats

setup.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,27 @@ fmt_header "Migrations"
410410

411411
run_migrations "$SCRIPT_DIR"
412412

413+
# ---------------------------------------------------------------------------
414+
# Work directory
415+
# ---------------------------------------------------------------------------
416+
417+
WORK_DIR="$HOME/Work"
418+
DEVSETUP_DIR="$WORK_DIR/devsetup"
419+
420+
fmt_header "Work Directory"
421+
422+
mkdir -p "$WORK_DIR"
423+
fmt_ok "$WORK_DIR ready"
424+
425+
if [ -d "$DEVSETUP_DIR/.git" ]; then
426+
fmt_ok "devsetup already at $DEVSETUP_DIR"
427+
elif gh auth status > /dev/null 2>&1; then
428+
fmt_install "Cloning devsetup to $DEVSETUP_DIR"
429+
gh repo clone "${DEVSETUP_REPO:-trusted/devsetup}" "$DEVSETUP_DIR" -- --quiet
430+
else
431+
echo " Skipping devsetup clone (gh not authenticated)."
432+
fi
433+
413434
# ---------------------------------------------------------------------------
414435
# Done
415436
# ---------------------------------------------------------------------------
@@ -419,6 +440,6 @@ echo "= Trusted Dev Setup Complete ="
419440
echo ""
420441
echo "Next steps:"
421442
echo " 1. Open a new terminal (or run: source ~/.zshrc)"
422-
echo " 2. Clone a project: gh repo clone trusted/<repo-name>"
443+
echo " 2. Clone a project: cd ~/Work && gh repo clone trusted/<repo-name>"
423444
echo " 3. Run project setup: cd <repo-name> && bin/setup"
424445
echo ""

test/setup_test.bats

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,19 @@
9191
@test "migration state directory exists" {
9292
[ -d "$HOME/.local/state/trusted/devsetup/migrations" ]
9393
}
94+
95+
# ---------------------------------------------------------------------------
96+
# Work directory
97+
# ---------------------------------------------------------------------------
98+
99+
@test "~/Work directory exists" {
100+
[ -d "$HOME/Work" ]
101+
}
102+
103+
@test "devsetup is cloned to ~/Work/devsetup" {
104+
[ -d "$HOME/Work/devsetup/.git" ]
105+
}
106+
107+
@test "~/Work/devsetup contains setup.sh" {
108+
[ -f "$HOME/Work/devsetup/setup.sh" ]
109+
}

0 commit comments

Comments
 (0)