You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- No arguments needed: setup.sh detects the shell from $SHELL, falling
back to installed shells with existing rc files
- git is now optional: falls back to a curl/wget tarball download,
staged so a failed fetch can't leave a half-install; re-running with
git available upgrades the install to a checkout
- Missing rc files are created instead of skipped with "re-run"
- doctor/update handle git-less installs gracefully
- New hermetic test suite for setup.sh, run in CI on ubuntu and
macOS system bash 3.2
(`setup.sh` and `tests/test_setup.sh` are bash-only — piped installs always run under bash — so they are excluded from the `zsh -n` check.)
34
+
33
35
`activator.sh` is sourced by both `bash` and `zsh`, so any zsh-specific syntax must be guarded by `[[ -n "$ZSH_VERSION" ]]` and any bash-specific syntax by `[[ -n "$BASH_VERSION" ]]`.
34
36
35
37
## Tests
36
38
37
-
The repo has two black-box test suites, neither of which needs Python or an external test framework:
39
+
The repo has three black-box test suites, none of which needs Python or an external test framework:
38
40
39
41
-[`tests/test_activator.sh`](tests/test_activator.sh) builds a fake project tree in a temp directory, sources `activator.sh`, and asserts behavior by invoking `_check_for_venv` directly.
40
42
-[`tests/test_subcommands.sh`](tests/test_subcommands.sh) sources the full config under a throwaway `$HOME` and exercises the `autoactivator` subcommands.
43
+
-[`tests/test_setup.sh`](tests/test_setup.sh) runs the installer end-to-end against a local fixture repo and tarball under throwaway `$HOME`s — no network. It is bash-only, like the installer itself.
41
44
42
-
Run both under both shells before opening a PR:
45
+
Run them before opening a PR (the first two under both shells):
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,18 +32,18 @@ If you activate a venv by hand, AutoActivator leaves it alone — no automatic s
32
32
## Requirements
33
33
34
34
-**bash** or **zsh**
35
-
-**git** — used for installation and updates
35
+
-**git** — recommended for installation and updates; without it, the installer falls back to a tarball download (needs **curl** or **wget**, plus **tar**)
36
36
- Linux or macOS (both covered by CI, including macOS's stock bash 3.2)
No arguments needed — the installer detects your shell from `$SHELL` and wires up the matching rc file (creating it if it doesn't exist). Want a specific shell (or both)? Pass it explicitly:
~/.autoactivator/setup.sh # optionally pass a shell: ~/.autoactivator/setup.sh zsh
66
66
```
67
67
68
68
</details>
@@ -82,6 +82,8 @@ autoactivator update
82
82
83
83
This pulls the latest changes and re-sources the hook in your current shell. The update will refuse to run if you have local modifications in `~/.autoactivator`.
84
84
85
+
Installed without git? `autoactivator update` will point you back to the install one-liner — re-running it refreshes the install in place (and upgrades it to a git checkout once git is available).
86
+
85
87
## Tool support
86
88
87
89
AutoActivator finds venvs that live **inside the project tree**. Here's how that maps to the common Python tools:
@@ -224,7 +225,11 @@ <h3 class="sub">And it's fast — a cd hook has no business being slow</h3>
224
225
225
226
<sectionid="install">
226
227
<h2>Install</h2>
227
-
<pclass="lede">You need <b>bash</b> or <b>zsh</b>, <b>git</b>, and Linux or macOS — both covered by CI, including macOS's stock bash 3.2. No Python required.</p>
228
+
<pclass="lede">You need <b>bash</b> or <b>zsh</b> and Linux or macOS — both covered by CI, including macOS's stock bash 3.2. <b>git</b> is recommended; without it the installer falls back to a tarball via <b>curl</b>/<b>wget</b> + <b>tar</b>. No Python required.</p>
<pclass="lede fine">No arguments needed — the installer detects your shell from <code>$SHELL</code> and creates the rc file if it's missing. Want a specific shell (or both)?</p>
<pclass="lede fine">Pulls the latest version and re-sources the hook in your current shell.</p>
244
+
<pclass="lede fine">Pulls the latest version and re-sources the hook in your current shell. Installed without git? Re-run the install one-liner instead — it refreshes the install in place (and upgrades it to a git checkout once git is available).</p>
<pclass="lede fine">Removes the hook from your rc files, backing them up first — add <code>--purge</code> to also delete <code>~/.autoactivator</code>.</p>
0 commit comments