Skip to content

Commit a8e6753

Browse files
committed
feat: support Git Bash PATH setup in install scripts (#89)
* feat: support Git Bash PATH setup in install scripts Windows users running Git Bash (MINGW/MSYS2) were not getting the archgate bin directory added to their shell profiles, causing `archgate` to not be found in Git Bash sessions. - install.sh: add MINGW/MSYS2 platform detection, download .zip artifact, and install archgate.exe on Windows - install.ps1: detect Git Bash shell profiles (~/.bashrc, ~/.bash_profile, ~/.profile) and offer to add PATH export with POSIX-formatted path * docs: add Git Bash installation instructions to EN and PT-BR pages Document that install.sh now works in Git Bash/MSYS2 on Windows and that install.ps1 detects Git Bash shell profiles for PATH setup. * docs: regenerate llms-full.txt * feat: add install URL redirects via Cloudflare Pages Add _redirects file for Cloudflare Pages so install scripts are available at shorter, branded URLs: - cli.archgate.dev/install-unix -> install.sh - cli.archgate.dev/install-windows -> install.ps1 Update all docs (EN + PT-BR), README, and CI integration guides to use the new short URLs with https://. * docs: regenerate llms-full.txt
1 parent 66944e8 commit a8e6753

11 files changed

Lines changed: 112 additions & 26 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ When a rule is violated, `archgate check` reports the file, line, and which ADR
4242

4343
```bash
4444
# macOS / Linux
45-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
45+
curl -fsSL https://cli.archgate.dev/install-unix | sh
4646

4747
# Windows (PowerShell)
48-
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
48+
irm https://cli.archgate.dev/install-windows | iex
49+
50+
# Windows (Git Bash / MSYS2)
51+
curl -fsSL https://cli.archgate.dev/install-unix | sh
4952
```
5053

5154
**Via npm** (or any Node.js package manager):
@@ -77,7 +80,7 @@ npx archgate check # run via package manager
7780

7881
```bash
7982
# 1. Install
80-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh # or: npm install -g archgate
83+
curl -fsSL https://cli.archgate.dev/install-unix | sh # or: npm install -g archgate
8184

8285
# 2. Initialize governance in your project
8386
cd my-project

docs/public/_redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Install script redirects
2+
/install-unix https://raw.githubusercontent.com/archgate/cli/main/install.sh 302
3+
/install-windows https://raw.githubusercontent.com/archgate/cli/main/install.ps1 302

docs/public/llms-full.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,19 @@ The fastest way to install Archgate — no Node.js or package manager required:
122122

123123
```bash
124124
# macOS / Linux
125-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
125+
curl -fsSL https://cli.archgate.dev/install-unix | sh
126126

127127
# Windows (PowerShell)
128-
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
128+
irm https://cli.archgate.dev/install-windows | iex
129+
130+
# Windows (Git Bash / MSYS2)
131+
curl -fsSL https://cli.archgate.dev/install-unix | sh
129132
```
130133

131134
This downloads a pre-built binary for your platform and installs it to `~/.archgate/bin/`. The installer detects your shell profiles and offers to add the directory to your PATH.
132135

136+
On Windows, the PowerShell installer also detects Git Bash shell profiles (`.bashrc`, `.bash_profile`, `.profile`) and offers to configure PATH there as well.
137+
133138
You can customize the install with environment variables:
134139

135140
| Variable | Description | Default |
@@ -259,7 +264,7 @@ If you have not installed the CLI yet:
259264

260265
```bash
261266
# Standalone (no Node.js required)
262-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
267+
curl -fsSL https://cli.archgate.dev/install-unix | sh
263268

264269
# Or via npm
265270
npm install -g archgate
@@ -1013,7 +1018,7 @@ jobs:
10131018
runs-on: ubuntu-latest
10141019
steps:
10151020
- uses: actions/checkout@v4
1016-
- run: curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
1021+
- run: curl -fsSL https://cli.archgate.dev/install-unix | sh
10171022
- run: ~/.archgate/bin/archgate check --ci
10181023
```
10191024

docs/src/content/docs/getting-started/installation.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ The fastest way to install Archgate — no Node.js or package manager required:
99

1010
```bash
1111
# macOS / Linux
12-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
12+
curl -fsSL https://cli.archgate.dev/install-unix | sh
1313

1414
# Windows (PowerShell)
15-
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
15+
irm https://cli.archgate.dev/install-windows | iex
16+
17+
# Windows (Git Bash / MSYS2)
18+
curl -fsSL https://cli.archgate.dev/install-unix | sh
1619
```
1720

1821
This downloads a pre-built binary for your platform and installs it to `~/.archgate/bin/`. The installer detects your shell profiles and offers to add the directory to your PATH.
1922

23+
On Windows, the PowerShell installer also detects Git Bash shell profiles (`.bashrc`, `.bash_profile`, `.profile`) and offers to configure PATH there as well.
24+
2025
You can customize the install with environment variables:
2126

2227
| Variable | Description | Default |

docs/src/content/docs/getting-started/quick-start.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ If you have not installed the CLI yet:
99

1010
```bash
1111
# Standalone (no Node.js required)
12-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
12+
curl -fsSL https://cli.archgate.dev/install-unix | sh
1313

1414
# Or via npm
1515
npm install -g archgate

docs/src/content/docs/guides/ci-integration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169
runs-on: ubuntu-latest
170170
steps:
171171
- uses: actions/checkout@v4
172-
- run: curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
172+
- run: curl -fsSL https://cli.archgate.dev/install-unix | sh
173173
- run: ~/.archgate/bin/archgate check --ci
174174
```
175175

docs/src/content/docs/pt-br/getting-started/installation.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ A forma mais rápida de instalar o Archgate — sem necessidade de Node.js ou ge
99

1010
```bash
1111
# macOS / Linux
12-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
12+
curl -fsSL https://cli.archgate.dev/install-unix | sh
1313

1414
# Windows (PowerShell)
15-
irm https://raw.githubusercontent.com/archgate/cli/main/install.ps1 | iex
15+
irm https://cli.archgate.dev/install-windows | iex
16+
17+
# Windows (Git Bash / MSYS2)
18+
curl -fsSL https://cli.archgate.dev/install-unix | sh
1619
```
1720

1821
Isso baixa um binário pré-compilado para sua plataforma e instala em `~/.archgate/bin/`. O instalador detecta os perfis do seu shell e oferece adicionar o diretório ao seu PATH.
1922

23+
No Windows, o instalador PowerShell também detecta perfis de shell do Git Bash (`.bashrc`, `.bash_profile`, `.profile`) e oferece configurar o PATH neles.
24+
2025
Você pode personalizar a instalação com variáveis de ambiente:
2126

2227
| Variável | Descrição | Padrão |

docs/src/content/docs/pt-br/getting-started/quick-start.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Se você ainda não instalou a CLI:
99

1010
```bash
1111
# Standalone (sem necessidade de Node.js)
12-
curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
12+
curl -fsSL https://cli.archgate.dev/install-unix | sh
1313

1414
# Ou via npm
1515
npm install -g archgate

docs/src/content/docs/pt-br/guides/ci-integration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169
runs-on: ubuntu-latest
170170
steps:
171171
- uses: actions/checkout@v4
172-
- run: curl -fsSL https://raw.githubusercontent.com/archgate/cli/main/install.sh | sh
172+
- run: curl -fsSL https://cli.archgate.dev/install-unix | sh
173173
- run: ~/.archgate/bin/archgate check --ci
174174
```
175175

install.ps1

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,49 @@ if ($CurrentPath -notlike "*$InstallDir*") {
9393
Write-Host "Restart your terminal for the change to take effect in new sessions."
9494
}
9595

96+
# --- Update Git Bash / MSYS2 shell profiles ---
97+
98+
$GitBashProfiles = @()
99+
foreach ($f in @("$HOME\.bashrc", "$HOME\.bash_profile", "$HOME\.profile")) {
100+
if (Test-Path $f) {
101+
$GitBashProfiles += $f
102+
break
103+
}
104+
}
105+
106+
$InstallDirPosix = $InstallDir -replace '\\', '/' -replace '^([A-Za-z]):', '/$1'
107+
$PathLine = "export PATH=`"$InstallDirPosix:`$PATH`""
108+
109+
$NeedsUpdate = @()
110+
foreach ($f in $GitBashProfiles) {
111+
if (-not (Select-String -Path $f -SimpleMatch $InstallDirPosix -Quiet)) {
112+
$NeedsUpdate += $f
113+
}
114+
}
115+
116+
if ($NeedsUpdate.Count -gt 0) {
117+
Write-Host ""
118+
Write-Host "Detected Git Bash shell profiles to update:"
119+
foreach ($f in $NeedsUpdate) {
120+
Write-Host " $f -> $PathLine"
121+
}
122+
Write-Host ""
123+
124+
$answer = Read-Host "Update these files now? [Y/n]"
125+
if ($answer -match '^[nN]') {
126+
Write-Host ""
127+
Write-Host "Skipped. To add manually, append this line to your shell profile:"
128+
Write-Host ""
129+
Write-Host " $PathLine"
130+
} else {
131+
foreach ($f in $NeedsUpdate) {
132+
Add-Content -Path $f -Value "`n# archgate`n$PathLine"
133+
Write-Host " Updated: $f"
134+
}
135+
Write-Host ""
136+
Write-Host "Restart Git Bash for the change to take effect."
137+
}
138+
}
139+
96140
Write-Host ""
97141
Write-Host "Run 'archgate --help' to get started."

0 commit comments

Comments
 (0)