Skip to content

Commit 0f0b5ec

Browse files
authored
feat: allow user to input to select hooks to install (#58)
1 parent e5e769c commit 0f0b5ec

6 files changed

Lines changed: 218 additions & 263 deletions

File tree

‎README.md‎

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,75 @@
77

88
Read the full documentation at [freightapp.co](https://freightapp.co).
99

10-
Freight streamlines Git workflows by rewiring every Git hook in your repository to a single **Conductor** binary. All logic is defined in a declarative **Railcar** manifest (`railcar.json`), ensuring your hooks are portable, fast, and easy to manage.
10+
Freight streamlines Git workflows by rewiring every Git hook in your repository to a single **Conductor** binary. All
11+
logic is defined in a declarative **Railcar** manifest (`railcar.json`), ensuring your hooks are portable, fast, and
12+
easy to manage.
1113

1214
## Why Freight?
1315

1416
### 🚀 Zero Runtime Dependencies
15-
Unlike Husky (which requires Node.js) or pre-commit (which requires Python), Freight is a single, static Go binary. Your developers don't need to install a specific runtime just to run Git hooks.
17+
18+
Unlike Husky (which requires Node.js) or pre-commit (which requires Python), Freight is a single, static Go binary. Your
19+
developers don't need to install a specific runtime just to run Git hooks.
1620

1721
### 📦 Unified Configuration
18-
Manage every hook—from `pre-commit` to `post-merge`—in one `railcar.json` manifest. No more messy `.git/hooks` directory filled with ad-hoc scripts.
22+
23+
Manage every hook—from `pre-commit` to `post-merge`—in one `railcar.json` manifest. No more messy `.git/hooks` directory
24+
filled with ad-hoc scripts.
1925

2026
### 🛠️ Built for Portability
27+
2128
Freight's 'Conductor/Railcar' architecture ensures that your hooks work identically across Windows, macOS, and Linux.
2229

2330
### 🥊 Freight vs. Husky
24-
| Feature | Freight | Husky |
25-
|---------|---------|-------|
26-
| **Runtime** | None (Static Binary) | Node.js |
27-
| **Setup** | `freight init` | `npm install` |
28-
| **Config** | Single JSON file | Multiple files/package.json |
29-
| **Portability** | High (Binary included) | Moderate (Requires Node) |
31+
32+
| Feature | Freight | Husky |
33+
|-----------------|------------------------|-----------------------------|
34+
| **Runtime** | None (Static Binary) | Node.js |
35+
| **Setup** | `freight init` | `npm install` |
36+
| **Config** | Single JSON file | Multiple files/package.json |
37+
| **Portability** | High (Binary included) | Moderate (Requires Node) |
3038

3139
---
3240

3341
## Quick Start
3442

3543
### 1. Install
44+
3645
- **Homebrew (macOS):** `brew install --cask devbytes-cloud/tap/freight`
37-
- **Precompiled Binaries:** `[GitHub Releases](https://github.com/devbytes-cloud/freight/releases)`
46+
- **Precompiled Binaries:** [GitHub Releases](https://github.com/devbytes-cloud/freight/releases)
3847

3948
### 2. Setup
49+
4050
Run the following command in your Git repository:
51+
4152
```bash
4253
freight init
4354
```
55+
4456
This installs the **Conductor** binary and creates a starter **Railcar** manifest (`railcar.json`).
4557

58+
By default, Freight installs all supported Git hooks. You can use the `--allow` (or `-a`) flag to specify only the hooks
59+
you want:
60+
61+
```bash
62+
freight init --allow pre-commit,commit-msg
63+
```
64+
65+
Valid hooks are: `pre-commit`, `prepare-commit-msg`, `commit-msg`, `post-commit`, and `post-checkout`.
66+
4667
### 3. Verify
68+
4769
Add a script to your `railcar.json` and watch it run on your next commit!
4870

4971
---
5072

5173
## Architecture: Conductor & Railcar
5274

5375
Freight operates on a simple, powerful metaphor:
54-
- **The Conductor:** A tiny, high-performance binary placed at your repo root. It is the single entry point for all Git hooks.
76+
77+
- **The Conductor:** A tiny, high-performance binary placed at your repo root. It is the single entry point for all Git
78+
hooks.
5579
- **The Railcar:** A `railcar.json` manifest that defines exactly what the Conductor should execute for each hook.
5680

5781
When a Git hook fires, the Conductor extracts the logic from the Railcar and executes it with precision.

‎docs/readme.md‎

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

0 commit comments

Comments
 (0)