95 lines
2.4 KiB
Markdown
95 lines
2.4 KiB
Markdown
# homesick
|
|
|
|
[](https://git.hrafn.xyz/aether/gosick/actions/workflows/push-validation.yml)
|
|
[](https://s3.hrafn.xyz/aether-workflow-report-artefacts/gosick/branch/main/coverage.html)
|
|
|
|
Your home directory is your castle. Don't leave your dotfiles behind.
|
|
|
|
This repository now contains a Go implementation of Homesick. A dotfiles repository is called a castle and should contain a `home/` directory with files to link into your `$HOME`.
|
|
|
|
## Build
|
|
|
|
Build with just:
|
|
|
|
```bash
|
|
just go-build
|
|
```
|
|
|
|
Or directly with Go:
|
|
|
|
```bash
|
|
go build -o dist/gosick ./cmd/homesick
|
|
```
|
|
|
|
## Commands
|
|
|
|
Implemented commands:
|
|
|
|
- `clone URI [CASTLE_NAME]`
|
|
- `list`
|
|
- `show_path [CASTLE]`
|
|
- `status [CASTLE]`
|
|
- `diff [CASTLE]`
|
|
- `link [CASTLE]`
|
|
- `unlink [CASTLE]`
|
|
- `track FILE [CASTLE]`
|
|
- `pull [--all|CASTLE]`
|
|
- `push [CASTLE]`
|
|
- `commit -m MESSAGE [CASTLE]`
|
|
- `destroy [CASTLE]`
|
|
- `cd [CASTLE]`
|
|
- `open [CASTLE]`
|
|
- `exec CASTLE COMMAND...`
|
|
- `exec_all COMMAND...`
|
|
- `generate PATH`
|
|
- `rc [--force] [CASTLE]`
|
|
- `version`
|
|
|
|
Global options:
|
|
|
|
- `--pretend` simulates command execution for shell/git-backed operations.
|
|
- `--dry-run` is an alias for `--pretend`.
|
|
- `--quiet` suppresses status output.
|
|
|
|
### rc behavior
|
|
|
|
- Runs executable scripts in `<castle>/.homesick.d/` in lexicographic order.
|
|
- Executes scripts with the castle root as the current working directory.
|
|
- Forwards script stdout/stderr to command output.
|
|
- If `<castle>/.homesickrc` exists, `--force` is required before legacy Ruby compatibility hooks are run.
|
|
- If `<castle>/.homesickrc` exists and `<castle>/.homesick.d/parity.rb` does not, generates `parity.rb` before execution.
|
|
- Never overwrites an existing `parity.rb` wrapper.
|
|
|
|
### exec behavior
|
|
|
|
- `exec CASTLE COMMAND...` runs the shell command inside the target castle root.
|
|
- `exec_all COMMAND...` runs the same shell command inside each cloned castle root in sorted order.
|
|
|
|
## Behavior Suite
|
|
|
|
The repository includes a Docker-based behavior suite that validates filesystem and git outcomes for the implemented commands.
|
|
|
|
Run behavior suite:
|
|
|
|
```bash
|
|
just behavior
|
|
```
|
|
|
|
Verbose behavior suite output:
|
|
|
|
```bash
|
|
just behavior-verbose
|
|
```
|
|
|
|
## Testing
|
|
|
|
Run all Go tests:
|
|
|
|
```bash
|
|
just go-test
|
|
```
|
|
|
|
## License
|
|
|
|
See `LICENSE`.
|