Move `doc/adr/` to `adr/` for discoverability. Remove the generic
ADR README — `ls adr/` serves the same purpose.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Searching for `.git/` in file paths incorrectly matched directory names
ending with `.git` (e.g., `personal.git/cheat/hello`), causing sheets
under such paths to be silently skipped. Fix by requiring the path
separator on both sides (`/.git/`), so `.git` is only matched as a
complete path component.
Rewrites test suite with comprehensive coverage for all six documented
edge cases, including the #711 scenario and combination cases (e.g.,
a real .git directory inside a .git-suffixed parent).
Closes#711
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, env vars were only consulted during config generation
and baked into conf.yml. At runtime, the config file value was
always used, making it impossible to override the editor via
environment variables.
Now the precedence is: $VISUAL > $EDITOR > conf.yml > auto-detect.
Closes#589
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This workflow has been failing for years due to an expired/missing
COMMITTER_TOKEN. Homebrew maintains their own automated version
bump pipeline, making this redundant.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eliminates glibc version mismatch errors when running release
binaries on systems with older glibc versions.
Closes#744
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cheat --init now comments out the community cheatpath by default and
includes a git clone instruction with the resolved path. This prevents
warnings about missing directories when users save the --init output
as their config without also cloning community cheatsheets.
Closes#773
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prompt() created a new bufio.NewReader(os.Stdin) on each call, which
buffered all piped input on the first call and left nothing for
subsequent prompts. This made cheat un-scriptable (e.g., piping answers
via printf). Fix by reading one byte at a time from os.Stdin directly.
Also adds an end-to-end integration test for the first-run experience
(regression test for #721, #771, #730) and bumps the Dockerfile to
Go 1.26.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- cmdInit (--init) now substitutes EDITOR_PATH, PAGER_PATH, and
WORK_PATH instead of leaving them as literal strings
- Installer now substitutes WORK_PATH and always creates personal
and work directories regardless of community cheatsheet choice
- When community cheatsheets are declined, the community cheatpath
is commented out in the generated config
- config.New() skips nonexistent cheatpaths with a warning instead
of hard-erroring on EvalSymlinks failure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add .gitattributes to force LF in mock files (Windows autocrlf)
- Fix parse.go: detect line endings from content instead of runtime.GOOS
- Add fail-fast: false to CI matrix; trigger on all branch pushes
- Skip chmod-based tests on Windows (permissions work differently)
- Use filepath.Join for expected paths in Windows path tests
- Use platform-appropriate invalid paths in error tests
- Add Windows absolute path test case for ValidateSheetName
- Skip Unix-specific integration tests on Windows
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Resolve symlinks in temp dir paths (macOS /var -> /private/var)
- Pre-create non-empty community dir to ensure clone fails reliably
regardless of network access on CI runners
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bump Go from 1.19 to 1.26 and update all dependencies
- Rewrite CI workflow with matrix strategy (Linux, macOS, Windows)
- Update GitHub Actions to current versions (checkout@v4, setup-go@v5)
- Update CodeQL actions from v1 to v3
- Fix cross-platform bug in mock/path.go (path.Join -> filepath.Join)
- Clean up dependabot config (weekly schedule, remove stale ignore)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Refactor `installer.clone` into new `repo.Clone` package and method.
- Refactor `sheets.isGitDir` into `repo.GitDir`.
Both of these changes read better, and will facilitate cleaner
architecture when `--update` is implemented.
Integrate `go-git` into the application, and use it to `git clone`
cheatsheets when the installer runs.
Previously, the installer required that `git` be installed on the system
`PATH`, so this change has to big advantages:
1. It removes that system dependency on `git`
2. It paves the way for implementing the `--update` command
Additionally, `cheat` now performs a `--depth=1` clone when installing
cheatsheets, which should at least somewhat improve installation times
(especially on slow network connections).
- Fix an issue whereby `make clean` filed to remove assets created by
`make generate`.
- Fix a subsequent issue whereby `make generate` was being run too late
in the `make build` target, which resulted in a build failure.