Skip to content

Commit 505f644

Browse files
committed
Clean up repository issues
- Remove Omarchy distribution support (directory was already deleted) - Remove generic/github-add-key script and references (SSH keys handled during auth) - Remove generic/lazyvim script (already deleted, cleaning up references) - Fix scripts/check.sh to exclude markdown files from bash syntax checks - Update copilot-instructions.md to reflect current state and resolved issues
1 parent fe8b07f commit 505f644

File tree

7 files changed

+83
-44
lines changed

7 files changed

+83
-44
lines changed

.github/copilot-instructions.md

Lines changed: 82 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ Because scripts are sourced (not executed in a subshell) they run in the current
1010

1111
## Project structure and conventions
1212

13-
- `bootstrap` (top-level): dispatches to a distro directory after reading `/etc/os-release`.
13+
- `bootstrap` (top-level): dispatches to a distro directory after reading `/etc/os-release`. Supports Ubuntu, Pop!_OS, Fedora, and Arch.
1414
- `*/bootstrap` (per-distro): orchestrates other scripts in that distro folder and the shared `generic/` helpers.
15-
- `generic/`: small reusable steps (create-ssh-key, install-jetbrains-tools, install-zsh-customizations, lazyvim, etc.). Treat these as library modules that are `source`d by distro bootstrappers.
15+
- `generic/`: small reusable steps (create-ssh-key, install-jetbrains-tools, install-zsh-customizations, github-auth-login/logout, add-user-to-groups, create-directories, homebrew). Treat these as library modules that are `source`d by distro bootstrappers.
1616
- `*/*install-*-packages` files: contain package lists and package-manager-specific commands (apt, dnf, pacman, yay). Be careful when modifying package sets — keep package-manager flags and ordering intact.
17+
- `test/`: contains Docker and QEMU testing infrastructure for validation (primarily for Ubuntu).
18+
- `scripts/`: helper scripts like `check.sh` for local syntax and shellcheck validation.
19+
- `Makefile`: provides convenient targets for testing, linting, and building test images.
1720

1821
Examples to reference when changing behavior:
1922
- Distribution detection: `bootstrap` (reads `/etc/os-release` and branches on `ID`).
2023
- Arch essentials: `arch/install-essential-packages` (enables multilib, calls `pacman`, handles AUR with `yay`).
2124
- Ubuntu interactive flow: `ubuntu/bootstrap` (prompts with `read -p` and conditionally runs dev/desktop/media installs).
25+
- Fedora/Pop!_OS flow: similar interactive prompts for optional component installation.
2226

2327
## Interaction & side-effects to watch for
2428

@@ -31,26 +35,92 @@ Examples to reference when changing behavior:
3135
- Preserve the `source <(curl -fsSL ...)` style where callers expect that pattern. If you introduce an alternate execution method, add a usage comment and keep backward compatibility.
3236
- When modifying package lists, keep package-manager specific flags (e.g., `--needed` for `pacman`, `-y`/`-qq` for `apt`) and preserve any pre-update steps (e.g., `apt-get update`).
3337
- Reuse `generic/` helpers rather than duplicating logic across distros.
38+
- The `lazyvim` generic helper has been removed — LazyVim setup was previously auto-installed but is no longer part of the bootstrap process.
3439

3540
## Testing and validation (how to be productive quickly)
3641

37-
- Quick lint: run `bash -n <script>` to check syntax.
38-
- Static checks: run `shellcheck` (recommended) on changed scripts.
39-
- Safe manual test: start a disposable VM or container for the target distribution and run the top-level `source <(...)` or the distro `bootstrap` directly.
42+
### Local validation
4043

41-
## Known issues and fragile areas (observations you can trust)
44+
Run the local validation script to check for bash syntax errors and shellcheck issues:
4245

43-
- The top-level `bootstrap` contains a malformed `elif` for the `arch` branch (missing spacing around `[[`), and `pop_os/bootstrap` contains a garbled line in the optical-disc install section. Be conservative when editing these lines — tests and a VM run are recommended.
46+
```sh
47+
bash scripts/check.sh
48+
```
49+
50+
This script:
51+
- Finds all bash scripts (files with a bash shebang).
52+
- Runs `bash -n` to check for syntax errors.
53+
- Runs ShellCheck to report style and correctness issues (errors only).
54+
- Suggests installation steps if ShellCheck is not available.
55+
56+
You can also use the Makefile targets:
57+
58+
```sh
59+
make lint # Run shellcheck on all scripts
60+
make test-syntax # Run bash -n syntax checks
61+
make test # Run automated Docker tests (Ubuntu)
62+
make test-all # Test all Ubuntu versions (24.04, 25.10)
63+
```
64+
65+
### Docker testing (Ubuntu)
66+
67+
Quick Docker-based testing for package installation validation:
68+
69+
```sh
70+
# Interactive testing
71+
make test-interactive
72+
73+
# Automated testing
74+
make test
75+
76+
# Test all Ubuntu versions
77+
make test-all
78+
```
79+
80+
See `test/README.md` for detailed Docker and QEMU testing instructions.
81+
82+
### CI checks
83+
84+
GitHub Actions automatically run on push/PR:
85+
- `.github/workflows/ci.yml`: runs bash syntax checks and ShellCheck on all shell scripts
86+
- `.github/workflows/test-ubuntu.yml`: runs Docker-based Ubuntu bootstrap tests on multiple Ubuntu versions (24.04, 25.10)
87+
88+
Both workflows use ShellCheck with `--severity=error` (warnings are advisory, errors block merge).
89+
90+
## Known issues and gaps (observations you can trust)
91+
92+
- **Arch bootstrap incomplete**: The `arch/bootstrap` file is sparse and noted in the README as "not fully baked yet".
4493

4594
## What to commit and why
4695

4796
- Keep commits small and focused: package list changes, distribution-specific fixes, or refactors of `generic/` helpers.
4897
- When adding non-interactive automation, add a clearly marked `_noninteractive` variant or a flag guarded by an environment variable so the interactive default remains for humans.
98+
- Run `bash scripts/check.sh` before committing to catch syntax errors and shellcheck issues.
99+
- For Ubuntu changes, consider running `make test` to validate changes in Docker.
49100

50101
## Where to look next (files that exemplify common tasks)
51102

52-
- `bootstrap` (root)
53-
- `ubuntu/bootstrap`, `pop_os/bootstrap`, `fedora/bootstrap`, `arch/bootstrap`
54-
- `generic/create-ssh-key`, `generic/install-jetbrains-tools`, `arch/install-essential-packages`, `ubuntu/install-essential-packages`
55-
56-
If any section is unclear or you'd like the file to be more prescriptive (for example adding linting CI or a non-interactive test harness), tell me which area to expand and I will iterate.
103+
### Core entry points
104+
- `bootstrap` (root): distribution detection and routing
105+
- `ubuntu/bootstrap`, `pop_os/bootstrap`, `fedora/bootstrap`, `arch/bootstrap`: per-distro orchestration
106+
107+
### Package installation examples
108+
- `ubuntu/install-essential-packages`: apt-based package installation with proper update/upgrade flow
109+
- `arch/install-essential-packages`: pacman and AUR (yay) package installation with multilib
110+
- `fedora/install-packages`: dnf-based installation
111+
112+
### Generic helpers
113+
- `generic/create-ssh-key`: SSH key generation pattern
114+
- `generic/install-jetbrains-tools`: third-party tool installation (Toolbox)
115+
- `generic/install-zsh-customizations`: shell customization setup
116+
- `generic/homebrew`: Homebrew installation on Linux
117+
- `generic/github-auth-login` / `generic/github-auth-logout`: GitHub CLI authentication
118+
119+
### Testing infrastructure
120+
- `test/run-tests.sh`: main test runner script
121+
- `test/docker/Dockerfile.ubuntu`: interactive Docker test image
122+
- `test/docker/Dockerfile.ubuntu-noninteractive`: automated test image
123+
- `test/README.md`: comprehensive testing documentation
124+
- `Makefile`: convenient test and lint targets
125+
126+
If any section is unclear or you'd like the file to be more prescriptive (for example adding specific debugging techniques or extending CI capabilities), tell me which area to expand and I will iterate.

bootstrap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ then
1515
elif [[ "$ID" == "fedora" ]]
1616
then
1717
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/fedora/bootstrap)
18-
elif [[ -d $HOME/.config/omarchy ]]
19-
then
20-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/omarchy/bootstrap)
2118
elif [[ "$ID" == "arch" ]]
2219
then
2320
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/arch/bootstrap)

fedora/bootstrap

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/m
2121
# Install packages
2222
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/fedora/install-packages)
2323

24-
# Lazyvim
25-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/lazyvim)
26-
2724
# Zsh customizations
2825
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/install-zsh-customizations)
2926

@@ -36,9 +33,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/m
3633
# Authenticate to GitHub
3734
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-login)
3835

39-
# Add ssh key to GitHaub
40-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-add-key)
41-
4236
# Logout of GitHub
4337
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-logout)
4438

generic/lazyvim

Lines changed: 0 additions & 4 deletions
This file was deleted.

pop_os/bootstrap

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/m
1919
# Install packages
2020
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/pop_os/install-packages)
2121

22-
# Lazyvim
23-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/lazyvim)
24-
2522
# Homebrew
2623
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/homebrew)
2724

@@ -52,9 +49,6 @@ fi
5249
# Authenticate to GitHub
5350
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-login)
5451

55-
# Add ssh key to GitHub
56-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-add-key)
57-
5852
# Logout of GitHub
5953
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-logout)
6054

scripts/check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ TMPFILE=$(mktemp)
88
trap 'rm -f "$TMPFILE"' EXIT
99

1010
echo "Finding bash scripts (shebang contains 'bash')..."
11-
find . -type f -not -path './.git/*' -exec grep -Il '^#!.*\bbash\b' {} \; > "$TMPFILE" || true
11+
find . -type f -not -path './.git/*' ! -name '*.md' -exec grep -Il '^#!.*\bbash\b' {} \; > "$TMPFILE" || true
1212

1313
if [ ! -s "$TMPFILE" ]; then
1414
echo "No bash scripts found."

ubuntu/bootstrap

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/m
1919
# Essential
2020
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/ubuntu/install-essential-packages)
2121

22-
# Lazyvim
23-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/lazyvim)
24-
25-
# Starship - https://starship.rs/
26-
curl -sS https://starship.rs/install.sh | sh
27-
2822
# Dev packages
2923
read -p "Install development tools? " -n 1 -r
3024
echo
@@ -45,12 +39,6 @@ then
4539

4640
# Authenticate to GitHub
4741
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-login)
48-
49-
# Add ssh key to GitHaub
50-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-add-key)
51-
52-
# Logout of GitHub
53-
source <(curl -fsSL https://raw.githubusercontent.com/mapitman/linux-bootstrap/main/generic/github-auth-logout)
5442
fi
5543

5644
# Desktop packages

0 commit comments

Comments
 (0)