fixpm 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fixpm-0.3.0 → fixpm-0.3.2}/.github/workflows/ci.yml +42 -1
- {fixpm-0.3.0 → fixpm-0.3.2}/.github/workflows/release.yml +106 -74
- {fixpm-0.3.0 → fixpm-0.3.2}/PKG-INFO +12 -3
- {fixpm-0.3.0 → fixpm-0.3.2}/README.md +11 -2
- {fixpm-0.3.0 → fixpm-0.3.2}/bucket/fixpm.json +4 -4
- fixpm-0.3.2/go/go.mod +8 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/rules_gen.go +2 -2
- {fixpm-0.3.0 → fixpm-0.3.2}/packaging/homebrew-fixpm/Formula/fixpm.rb +74 -74
- {fixpm-0.3.0 → fixpm-0.3.2}/packaging/homebrew-fixpm/README.md +86 -86
- {fixpm-0.3.0 → fixpm-0.3.2}/scripts/install.ps1 +69 -50
- {fixpm-0.3.0 → fixpm-0.3.2}/scripts/install.sh +99 -79
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/__init__.py +1 -1
- fixpm-0.3.0/go/go.mod +0 -3
- {fixpm-0.3.0 → fixpm-0.3.2}/.gitignore +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/LICENSE +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/fixpm.spec +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/corrector.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/detector.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/distance.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/main.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/packages.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/parity_test.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/pymath.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/rules.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/shlex.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/testdata/parity.json +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/go/util.go +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/pyproject.toml +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/scripts/gen_go_rules.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/scripts/gen_parity_vectors.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/__main__.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/cli.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/corrector.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/detector.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/distance.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/interactive.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/packages.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/__init__.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/base.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/cargo.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/docker.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/git.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/go.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/npm.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/npx.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/pip.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/pnpm.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/yarn.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/__init__.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/fixpm.bash +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/fixpm.ps1 +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/fixpm.zsh +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/tests/conftest.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_cli_doctor.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_cli_hook_init.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_corrections.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_distance.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_interactive.py +0 -0
- {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_packages.py +0 -0
|
@@ -40,7 +40,10 @@ jobs:
|
|
|
40
40
|
python-version: "3.12"
|
|
41
41
|
- uses: actions/setup-go@v5
|
|
42
42
|
with:
|
|
43
|
-
go-version:
|
|
43
|
+
go-version-file: go/go.mod
|
|
44
|
+
# No go.sum (the probe has no dependencies), so the cache step would
|
|
45
|
+
# only warn.
|
|
46
|
+
cache: false
|
|
44
47
|
|
|
45
48
|
- name: Install
|
|
46
49
|
run: |
|
|
@@ -66,3 +69,41 @@ jobs:
|
|
|
66
69
|
- name: Parity with the Python reference
|
|
67
70
|
run: go test ./...
|
|
68
71
|
working-directory: go
|
|
72
|
+
|
|
73
|
+
# The release workflow builds this binary on three platforms; until now
|
|
74
|
+
# nothing ran the result, and a macOS build that aborts on startup shipped
|
|
75
|
+
# straight to the release job. Building AND running it here is the gate that
|
|
76
|
+
# would have caught it.
|
|
77
|
+
probe-binary:
|
|
78
|
+
name: Probe binary (${{ matrix.os }})
|
|
79
|
+
runs-on: ${{ matrix.os }}
|
|
80
|
+
strategy:
|
|
81
|
+
fail-fast: false
|
|
82
|
+
matrix:
|
|
83
|
+
os: [ubuntu-latest, macos-latest]
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/checkout@v4
|
|
86
|
+
|
|
87
|
+
- uses: actions/setup-go@v5
|
|
88
|
+
with:
|
|
89
|
+
go-version-file: go/go.mod
|
|
90
|
+
cache: false
|
|
91
|
+
|
|
92
|
+
- name: Build
|
|
93
|
+
working-directory: go
|
|
94
|
+
run: go build -trimpath -ldflags="-s -w" -o "$RUNNER_TEMP/fixpm-probe" .
|
|
95
|
+
|
|
96
|
+
- name: Run it
|
|
97
|
+
shell: bash
|
|
98
|
+
run: |
|
|
99
|
+
set +e
|
|
100
|
+
out=$("$RUNNER_TEMP/fixpm-probe" --dry-run "docker container lss" 2>&1)
|
|
101
|
+
rc=$?
|
|
102
|
+
echo "exit=$rc"
|
|
103
|
+
echo "$out"
|
|
104
|
+
if [ "$rc" -ne 0 ] || ! printf '%s' "$out" | grep -q "docker container ls"; then
|
|
105
|
+
# Annotations stay readable without repository access, unlike step
|
|
106
|
+
# logs; a bare "exit code 134" costs a whole debugging round-trip.
|
|
107
|
+
echo "::error title=probe unusable on ${{ matrix.os }}::exit=$rc uname=$(uname -sm) go=$(go version | cut -d' ' -f3) output=${out}"
|
|
108
|
+
exit 1
|
|
109
|
+
fi
|
|
@@ -1,74 +1,106 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags: ["v*"]
|
|
6
|
-
|
|
7
|
-
permissions:
|
|
8
|
-
contents: write
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build:
|
|
12
|
-
strategy:
|
|
13
|
-
fail-fast: false
|
|
14
|
-
matrix:
|
|
15
|
-
include:
|
|
16
|
-
- os: windows-latest
|
|
17
|
-
artifact: fixpm-windows-x64.exe
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
run:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
include:
|
|
16
|
+
- os: windows-latest
|
|
17
|
+
artifact: fixpm-windows-x64.exe
|
|
18
|
+
probe: fixpm-probe-windows-x64.exe
|
|
19
|
+
- os: ubuntu-latest
|
|
20
|
+
artifact: fixpm-linux-x64
|
|
21
|
+
probe: fixpm-probe-linux-x64
|
|
22
|
+
- os: macos-latest
|
|
23
|
+
artifact: fixpm-macos-arm64
|
|
24
|
+
probe: fixpm-probe-macos-arm64
|
|
25
|
+
# note: macos-13 (intel) matrix entry removed — the runner label is
|
|
26
|
+
# effectively retired and queued forever; arm64 covers modern Macs.
|
|
27
|
+
runs-on: ${{ matrix.os }}
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.12"
|
|
34
|
+
|
|
35
|
+
# The probe is what the shell hook actually runs on the prompt path, so
|
|
36
|
+
# it has to ship as a prebuilt binary: requiring a Go toolchain to get
|
|
37
|
+
# the fast path would leave every binary/PyPI/Homebrew install on the
|
|
38
|
+
# slower Python fallback. Version comes from go/go.mod, not a pin here.
|
|
39
|
+
- uses: actions/setup-go@v5
|
|
40
|
+
with:
|
|
41
|
+
go-version-file: go/go.mod
|
|
42
|
+
cache: false # no go.sum: the probe has no dependencies
|
|
43
|
+
|
|
44
|
+
- name: Install
|
|
45
|
+
run: |
|
|
46
|
+
python -m pip install --upgrade pip
|
|
47
|
+
pip install . pyinstaller
|
|
48
|
+
|
|
49
|
+
- name: Build single-file executable
|
|
50
|
+
run: pyinstaller --onefile --name fixpm --paths src src/fixpm/__main__.py
|
|
51
|
+
|
|
52
|
+
- name: Rename artifact
|
|
53
|
+
shell: bash
|
|
54
|
+
run: |
|
|
55
|
+
cd dist
|
|
56
|
+
if [ -f fixpm.exe ]; then mv fixpm.exe "${{ matrix.artifact }}"; fi
|
|
57
|
+
if [ -f fixpm ] && [ ! -f "${{ matrix.artifact }}" ]; then mv fixpm "${{ matrix.artifact }}"; fi
|
|
58
|
+
ls -la
|
|
59
|
+
|
|
60
|
+
# Same flags the README documents for a local build, so a self-built
|
|
61
|
+
# probe and this asset differ only by toolchain version.
|
|
62
|
+
- name: Build the hook probe
|
|
63
|
+
working-directory: go
|
|
64
|
+
run: go build -trimpath -ldflags="-s -w" -o "../dist/${{ matrix.probe }}" .
|
|
65
|
+
|
|
66
|
+
- name: Smoke-test the built probe
|
|
67
|
+
shell: bash
|
|
68
|
+
run: |
|
|
69
|
+
set -e
|
|
70
|
+
cd dist
|
|
71
|
+
# A rules mismatch (stale generated tables) would show up as a
|
|
72
|
+
# missing fix, so assert a fix instead of just a zero exit code.
|
|
73
|
+
out=$("./${{ matrix.probe }}" --dry-run "docker container lss")
|
|
74
|
+
echo "$out"
|
|
75
|
+
echo "$out" | grep -F "docker container ls"
|
|
76
|
+
|
|
77
|
+
- name: Generate sha256 checksums
|
|
78
|
+
shell: bash
|
|
79
|
+
run: |
|
|
80
|
+
cd dist
|
|
81
|
+
sha256sum "${{ matrix.artifact }}" > "${{ matrix.artifact }}.sha256"
|
|
82
|
+
sha256sum "${{ matrix.probe }}" > "${{ matrix.probe }}.sha256"
|
|
83
|
+
cat "${{ matrix.artifact }}.sha256" "${{ matrix.probe }}.sha256"
|
|
84
|
+
|
|
85
|
+
- uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: ${{ matrix.artifact }}
|
|
88
|
+
path: |
|
|
89
|
+
dist/${{ matrix.artifact }}*
|
|
90
|
+
dist/${{ matrix.probe }}*
|
|
91
|
+
|
|
92
|
+
release:
|
|
93
|
+
needs: build
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
steps:
|
|
96
|
+
- name: Download all artifacts
|
|
97
|
+
uses: actions/download-artifact@v4
|
|
98
|
+
with:
|
|
99
|
+
path: release
|
|
100
|
+
merge-multiple: true
|
|
101
|
+
|
|
102
|
+
- name: Attach to GitHub Release
|
|
103
|
+
uses: softprops/action-gh-release@v2
|
|
104
|
+
with:
|
|
105
|
+
files: release/*
|
|
106
|
+
generate_release_notes: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: fixpm
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Interactive fixer for mistyped CLI commands — npm, git, docker, cargo, pip and go
|
|
5
5
|
Project-URL: Homepage, https://github.com/Max-code7997/fixpm
|
|
6
6
|
Project-URL: Repository, https://github.com/Max-code7997/fixpm
|
|
@@ -114,7 +114,8 @@ Or download the single-file executable + sha256 directly from
|
|
|
114
114
|
**Package managers:**
|
|
115
115
|
|
|
116
116
|
```bash
|
|
117
|
-
# Homebrew (macOS / Linux)
|
|
117
|
+
# Homebrew (macOS / Linux) — prebuilt binary, no Python and no compile step.
|
|
118
|
+
# Installs both `fixpm` and `fixpm-probe` (the fast path the hook prefers).
|
|
118
119
|
brew tap Max-code7997/fixpm https://github.com/Max-code7997/homebrew-fixpm
|
|
119
120
|
brew install fixpm
|
|
120
121
|
|
|
@@ -216,8 +217,16 @@ creation rather than detection.)
|
|
|
216
217
|
The shell hooks prefer `fixpm-probe` when it is on PATH and fall back to the
|
|
217
218
|
Python CLI otherwise. `fixpm doctor` reports which one is active.
|
|
218
219
|
|
|
220
|
+
It is published prebuilt, so you do not need a Go toolchain to get the fast
|
|
221
|
+
path: every release carries `fixpm-probe-<platform>-<arch>` (the same
|
|
222
|
+
`<platform>-<arch>` you find on the main binary), the Homebrew formula installs
|
|
223
|
+
it alongside `fixpm`, and `scripts/install.sh` fetches it when available.
|
|
224
|
+
|
|
219
225
|
```bash
|
|
220
|
-
|
|
226
|
+
# only needed if you want to build it yourself (needs Go >= 1.26: older
|
|
227
|
+
# toolchains strip LC_UUID out of the Mach-O, and macOS 15+ then refuses to
|
|
228
|
+
# load the binary. CI runs the built probe on every platform before release.)
|
|
229
|
+
cd go && go build -trimpath -ldflags="-s -w" -o ../fixpm-probe .
|
|
221
230
|
```
|
|
222
231
|
|
|
223
232
|
Rules are **not** duplicated: `scripts/gen_go_rules.py` generates
|
|
@@ -61,7 +61,8 @@ Or download the single-file executable + sha256 directly from
|
|
|
61
61
|
**Package managers:**
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
# Homebrew (macOS / Linux)
|
|
64
|
+
# Homebrew (macOS / Linux) — prebuilt binary, no Python and no compile step.
|
|
65
|
+
# Installs both `fixpm` and `fixpm-probe` (the fast path the hook prefers).
|
|
65
66
|
brew tap Max-code7997/fixpm https://github.com/Max-code7997/homebrew-fixpm
|
|
66
67
|
brew install fixpm
|
|
67
68
|
|
|
@@ -163,8 +164,16 @@ creation rather than detection.)
|
|
|
163
164
|
The shell hooks prefer `fixpm-probe` when it is on PATH and fall back to the
|
|
164
165
|
Python CLI otherwise. `fixpm doctor` reports which one is active.
|
|
165
166
|
|
|
167
|
+
It is published prebuilt, so you do not need a Go toolchain to get the fast
|
|
168
|
+
path: every release carries `fixpm-probe-<platform>-<arch>` (the same
|
|
169
|
+
`<platform>-<arch>` you find on the main binary), the Homebrew formula installs
|
|
170
|
+
it alongside `fixpm`, and `scripts/install.sh` fetches it when available.
|
|
171
|
+
|
|
166
172
|
```bash
|
|
167
|
-
|
|
173
|
+
# only needed if you want to build it yourself (needs Go >= 1.26: older
|
|
174
|
+
# toolchains strip LC_UUID out of the Mach-O, and macOS 15+ then refuses to
|
|
175
|
+
# load the binary. CI runs the built probe on every platform before release.)
|
|
176
|
+
cd go && go build -trimpath -ldflags="-s -w" -o ../fixpm-probe .
|
|
168
177
|
```
|
|
169
178
|
|
|
170
179
|
Rules are **not** duplicated: `scripts/gen_go_rules.py` generates
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"description": "Interactive fixer for
|
|
2
|
+
"version": "0.3.0",
|
|
3
|
+
"description": "Interactive fixer for mistyped CLI commands — npm, git, docker, cargo, pip and go.",
|
|
4
4
|
"homepage": "https://github.com/Max-code7997/fixpm",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"architecture": {
|
|
7
7
|
"64bit": {
|
|
8
|
-
"url": "https://github.com/Max-code7997/fixpm/releases/download/v0.
|
|
9
|
-
"hash": "
|
|
8
|
+
"url": "https://github.com/Max-code7997/fixpm/releases/download/v0.3.0/fixpm-windows-x64.exe",
|
|
9
|
+
"hash": "1a9cb6608b4121b67f8665d61edb7b8a651430a3e911635b154464618e5ddb83"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"bin": [
|
fixpm-0.3.2/go/go.mod
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
module github.com/Max-code7997/fixpm/go
|
|
2
|
+
|
|
3
|
+
// 1.26, not 1.22: older toolchains emit a Mach-O without LC_UUID when the
|
|
4
|
+
// binary is stripped, and macOS 15+ refuses to load such a binary
|
|
5
|
+
// ("dyld: missing LC_UUID load command", exit 134). The CI job that runs the
|
|
6
|
+
// built probe is what caught it. This is also the version the probe is
|
|
7
|
+
// verified with, so it is the honest floor.
|
|
8
|
+
go 1.26
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
package main
|
|
7
7
|
|
|
8
8
|
// version mirrors fixpm.__version__.
|
|
9
|
-
const version = "0.3.
|
|
9
|
+
const version = "0.3.2"
|
|
10
10
|
|
|
11
11
|
// userAgent mirrors fixpm.packages.USER_AGENT.
|
|
12
|
-
const userAgent = "fixpm/0.3.
|
|
12
|
+
const userAgent = "fixpm/0.3.2 (+https://github.com/Max-code7997/fixpm)"
|
|
13
13
|
|
|
14
14
|
// searchURL mirrors fixpm.packages.SEARCH_URL.
|
|
15
15
|
const searchURL = "https://registry.npmjs.org/-/v1/search"
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
class Fixpm < Formula
|
|
2
|
-
include Language::Python::Virtualenv
|
|
3
|
-
|
|
4
|
-
desc "Interactive fixer for
|
|
5
|
-
homepage "https://github.com/Max-code7997/fixpm"
|
|
6
|
-
url "https://files.pythonhosted.org/packages/
|
|
7
|
-
sha256 "
|
|
8
|
-
license "MIT"
|
|
9
|
-
|
|
10
|
-
depends_on "python@3.12"
|
|
11
|
-
|
|
12
|
-
resource "Pygments" do
|
|
13
|
-
url "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz"
|
|
14
|
-
sha256 "610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
resource "annotated-doc" do
|
|
18
|
-
url "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz"
|
|
19
|
-
sha256 "c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb"
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
resource "colorama" do
|
|
23
|
-
url "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz"
|
|
24
|
-
sha256 "08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
resource "markdown-it-py" do
|
|
28
|
-
url "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz"
|
|
29
|
-
sha256 "04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49"
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
resource "mdurl" do
|
|
33
|
-
url "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz"
|
|
34
|
-
sha256 "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
resource "prompt_toolkit" do
|
|
38
|
-
url "https://files.pythonhosted.org/packages/7d/ea/39b988c938f75cb75d7045b5c69f8bfed47ee2152c8837fb403de29d6fb8/prompt_toolkit-3.0.53.tar.gz"
|
|
39
|
-
sha256 "9ec8a0ad96d5c56148b3f914aa79c1564c3fde5d2e6b876e7bc327e353cf8fa6"
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
resource "questionary" do
|
|
43
|
-
url "https://files.pythonhosted.org/packages/f6/45/eafb0bba0f9988f6a2520f9ca2df2c82ddfa8d67c95d6625452e97b204a5/questionary-2.1.1.tar.gz"
|
|
44
|
-
sha256 "3d7e980292bb0107abaa79c68dd3eee3c561b83a0f89ae482860b181c8bd412d"
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
resource "rich" do
|
|
48
|
-
url "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz"
|
|
49
|
-
sha256 "edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36"
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
resource "shellingham" do
|
|
53
|
-
url "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz"
|
|
54
|
-
sha256 "8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
resource "typer" do
|
|
58
|
-
url "https://files.pythonhosted.org/packages/
|
|
59
|
-
sha256 "
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
resource "wcwidth" do
|
|
63
|
-
url "https://files.pythonhosted.org/packages/
|
|
64
|
-
sha256 "
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
def install
|
|
68
|
-
virtualenv_install_with_resources
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
test do
|
|
72
|
-
assert_match version.to_s, shell_output("#{bin}/fixpm --version")
|
|
73
|
-
end
|
|
74
|
-
end
|
|
1
|
+
class Fixpm < Formula
|
|
2
|
+
include Language::Python::Virtualenv
|
|
3
|
+
|
|
4
|
+
desc "Interactive fixer for mistyped CLI commands — npm, git, docker, cargo, pip and go"
|
|
5
|
+
homepage "https://github.com/Max-code7997/fixpm"
|
|
6
|
+
url "https://files.pythonhosted.org/packages/c5/12/ec203a68f38e1d178722a38689deadefe8f4493dfc2eae160f3c9b6a2b13/fixpm-0.3.0.tar.gz"
|
|
7
|
+
sha256 "502a300eb0732a1bfd59c002519d8d958da31af5c3b534bc757d84c9254c5a88"
|
|
8
|
+
license "MIT"
|
|
9
|
+
|
|
10
|
+
depends_on "python@3.12"
|
|
11
|
+
|
|
12
|
+
resource "Pygments" do
|
|
13
|
+
url "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz"
|
|
14
|
+
sha256 "610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
resource "annotated-doc" do
|
|
18
|
+
url "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz"
|
|
19
|
+
sha256 "c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
resource "colorama" do
|
|
23
|
+
url "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz"
|
|
24
|
+
sha256 "08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
resource "markdown-it-py" do
|
|
28
|
+
url "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz"
|
|
29
|
+
sha256 "04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
resource "mdurl" do
|
|
33
|
+
url "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz"
|
|
34
|
+
sha256 "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
resource "prompt_toolkit" do
|
|
38
|
+
url "https://files.pythonhosted.org/packages/7d/ea/39b988c938f75cb75d7045b5c69f8bfed47ee2152c8837fb403de29d6fb8/prompt_toolkit-3.0.53.tar.gz"
|
|
39
|
+
sha256 "9ec8a0ad96d5c56148b3f914aa79c1564c3fde5d2e6b876e7bc327e353cf8fa6"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
resource "questionary" do
|
|
43
|
+
url "https://files.pythonhosted.org/packages/f6/45/eafb0bba0f9988f6a2520f9ca2df2c82ddfa8d67c95d6625452e97b204a5/questionary-2.1.1.tar.gz"
|
|
44
|
+
sha256 "3d7e980292bb0107abaa79c68dd3eee3c561b83a0f89ae482860b181c8bd412d"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
resource "rich" do
|
|
48
|
+
url "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz"
|
|
49
|
+
sha256 "edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
resource "shellingham" do
|
|
53
|
+
url "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz"
|
|
54
|
+
sha256 "8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
resource "typer" do
|
|
58
|
+
url "https://files.pythonhosted.org/packages/16/f7/57713ba479fd405eb76de31404b2c744c289e336b2d999511ebf51e496f7/typer-0.27.2.tar.gz"
|
|
59
|
+
sha256 "269b7eb9d3c202ca84b4bc9618cb04ebb43d3d4d1e567e4c768607232c05f945"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
resource "wcwidth" do
|
|
63
|
+
url "https://files.pythonhosted.org/packages/3d/7a/f98d4ada7c499565ab0c0fcef28a4e54fafa72b8228a6309803c80493c92/wcwidth-0.8.4.tar.gz"
|
|
64
|
+
sha256 "2dae09efa25253ae2874188e86d6861af3b1652aef4118cdf3f0bda288a957fb"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def install
|
|
68
|
+
virtualenv_install_with_resources
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
test do
|
|
72
|
+
assert_match version.to_s, shell_output("#{bin}/fixpm --version")
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
# homebrew-fixpm
|
|
2
|
-
|
|
3
|
-
Homebrew tap for [fixpm](https://github.com/Max-code7997/fixpm) — interactive fixer for
|
|
4
|
-
|
|
5
|
-
## Install (users)
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
brew tap Max-code7997/fixpm https://github.com/Max-code7997/homebrew-fixpm
|
|
9
|
-
brew install fixpm
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
or in one line:
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
brew install Max-code7997/fixpm/fixpm
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Maintainers
|
|
19
|
-
|
|
20
|
-
### Repository setup
|
|
21
|
-
|
|
22
|
-
1. Create a new GitHub repo named `homebrew-fixpm` under `Max-code7997` (public, empty).
|
|
23
|
-
2. Copy this folder's contents as the repo root, so the layout is:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
homebrew-fixpm/
|
|
27
|
-
└── Formula/
|
|
28
|
-
└── fixpm.rb
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
3. Commit and push.
|
|
32
|
-
|
|
33
|
-
### Testing a formula change
|
|
34
|
-
|
|
35
|
-
Homebrew does not run on Windows — verify on a Mac, or spin up a one-off macOS
|
|
36
|
-
GitHub runner (see below).
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
brew install --build-from-source ./Formula/fixpm.rb # install from the local formula
|
|
40
|
-
fixpm --version && fixpm --dry-run "npm isntall react"
|
|
41
|
-
brew audit --strict ./Formula/fixpm.rb # style/lint checks
|
|
42
|
-
brew uninstall fixpm
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
One-off verification on a GitHub macOS runner (no Mac needed): create a
|
|
46
|
-
disposable workflow on any repo of yours:
|
|
47
|
-
|
|
48
|
-
```yaml
|
|
49
|
-
jobs:
|
|
50
|
-
formula-test:
|
|
51
|
-
runs-on: macos-latest
|
|
52
|
-
steps:
|
|
53
|
-
- uses: actions/checkout@v4
|
|
54
|
-
- run: brew install --build-from-source ./Formula/fixpm.rb
|
|
55
|
-
- run: |
|
|
56
|
-
fixpm --version
|
|
57
|
-
fixpm --dry-run "npm isntall react"
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Updating after a new fixpm release
|
|
61
|
-
|
|
62
|
-
The formula pins the PyPI **sdist** URL + sha256 for fixpm and every runtime
|
|
63
|
-
dependency. After publishing a new version to PyPI:
|
|
64
|
-
|
|
65
|
-
1. Resolve the dependency closure and fetch fresh url/sha256 pairs:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
pip install --dry-run --quiet --ignore-installed --report report.json fixpm==<NEW_VERSION>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
(`--ignore-installed` is essential — otherwise pip skips already-installed
|
|
72
|
-
deps and the closure comes back incomplete.)
|
|
73
|
-
|
|
74
|
-
2. Update `Formula/fixpm.rb`:
|
|
75
|
-
- fixpm's own `url` / `sha256`
|
|
76
|
-
- any dependency whose version changed (their `resource` url/sha256);
|
|
77
|
-
add/remove `resource` blocks if the dependency set changed
|
|
78
|
-
3. Sanity-check every changed pair by downloading the sdist and comparing:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
curl -fsSL -o /tmp/x.tar.gz "<url>" && shasum -a 256 /tmp/x.tar.gz
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
4. Run the test commands above, commit, push to `homebrew-fixpm`.
|
|
85
|
-
|
|
86
|
-
(An automation script for steps 1–2 is planned; until then this is manual.)
|
|
1
|
+
# homebrew-fixpm
|
|
2
|
+
|
|
3
|
+
Homebrew tap for [fixpm](https://github.com/Max-code7997/fixpm) — interactive fixer for mistyped CLI commands: npm, git, docker, cargo, pip and go.
|
|
4
|
+
|
|
5
|
+
## Install (users)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
brew tap Max-code7997/fixpm https://github.com/Max-code7997/homebrew-fixpm
|
|
9
|
+
brew install fixpm
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
or in one line:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
brew install Max-code7997/fixpm/fixpm
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Maintainers
|
|
19
|
+
|
|
20
|
+
### Repository setup
|
|
21
|
+
|
|
22
|
+
1. Create a new GitHub repo named `homebrew-fixpm` under `Max-code7997` (public, empty).
|
|
23
|
+
2. Copy this folder's contents as the repo root, so the layout is:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
homebrew-fixpm/
|
|
27
|
+
└── Formula/
|
|
28
|
+
└── fixpm.rb
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
3. Commit and push.
|
|
32
|
+
|
|
33
|
+
### Testing a formula change
|
|
34
|
+
|
|
35
|
+
Homebrew does not run on Windows — verify on a Mac, or spin up a one-off macOS
|
|
36
|
+
GitHub runner (see below).
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
brew install --build-from-source ./Formula/fixpm.rb # install from the local formula
|
|
40
|
+
fixpm --version && fixpm --dry-run "npm isntall react"
|
|
41
|
+
brew audit --strict ./Formula/fixpm.rb # style/lint checks
|
|
42
|
+
brew uninstall fixpm
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
One-off verification on a GitHub macOS runner (no Mac needed): create a
|
|
46
|
+
disposable workflow on any repo of yours:
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
jobs:
|
|
50
|
+
formula-test:
|
|
51
|
+
runs-on: macos-latest
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
- run: brew install --build-from-source ./Formula/fixpm.rb
|
|
55
|
+
- run: |
|
|
56
|
+
fixpm --version
|
|
57
|
+
fixpm --dry-run "npm isntall react"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Updating after a new fixpm release
|
|
61
|
+
|
|
62
|
+
The formula pins the PyPI **sdist** URL + sha256 for fixpm and every runtime
|
|
63
|
+
dependency. After publishing a new version to PyPI:
|
|
64
|
+
|
|
65
|
+
1. Resolve the dependency closure and fetch fresh url/sha256 pairs:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install --dry-run --quiet --ignore-installed --report report.json fixpm==<NEW_VERSION>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
(`--ignore-installed` is essential — otherwise pip skips already-installed
|
|
72
|
+
deps and the closure comes back incomplete.)
|
|
73
|
+
|
|
74
|
+
2. Update `Formula/fixpm.rb`:
|
|
75
|
+
- fixpm's own `url` / `sha256`
|
|
76
|
+
- any dependency whose version changed (their `resource` url/sha256);
|
|
77
|
+
add/remove `resource` blocks if the dependency set changed
|
|
78
|
+
3. Sanity-check every changed pair by downloading the sdist and comparing:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
curl -fsSL -o /tmp/x.tar.gz "<url>" && shasum -a 256 /tmp/x.tar.gz
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
4. Run the test commands above, commit, push to `homebrew-fixpm`.
|
|
85
|
+
|
|
86
|
+
(An automation script for steps 1–2 is planned; until then this is manual.)
|
|
@@ -1,50 +1,69 @@
|
|
|
1
|
-
# fixpm installer for Windows PowerShell.
|
|
2
|
-
#
|
|
3
|
-
# One-line install:
|
|
4
|
-
# irm https://raw.githubusercontent.com/Max-code7997/fixpm/main/scripts/install.ps1 | iex
|
|
5
|
-
#
|
|
6
|
-
# Overrides (testing / mirrors):
|
|
7
|
-
# $env:FIXPM_RELEASE_BASE download base URL (default: latest GitHub release)
|
|
8
|
-
# $env:FIXPM_INSTALL_DIR target directory (default: $env:LOCALAPPDATA\fixpm\bin)
|
|
9
|
-
|
|
10
|
-
$ErrorActionPreference = "Stop"
|
|
11
|
-
$ProgressPreference = "SilentlyContinue" # Invoke-WebRequest is unusably slow with the progress bar
|
|
12
|
-
|
|
13
|
-
$Repo = "Max-code7997/fixpm"
|
|
14
|
-
$Base = if ($env:FIXPM_RELEASE_BASE) { $env:FIXPM_RELEASE_BASE }
|
|
15
|
-
else { "https://github.com/$Repo/releases/latest/download" }
|
|
16
|
-
$DestDir = if ($env:FIXPM_INSTALL_DIR) { $env:FIXPM_INSTALL_DIR }
|
|
17
|
-
else { Join-Path $env:LOCALAPPDATA "fixpm\bin" }
|
|
18
|
-
$Asset = "fixpm-windows-x64.exe"
|
|
19
|
-
|
|
20
|
-
# Older Windows PowerShell defaults to TLS 1.0, which GitHub rejects.
|
|
21
|
-
[Net.ServicePointManager]::SecurityProtocol = `
|
|
22
|
-
[Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
|
|
23
|
-
|
|
24
|
-
$tmp = New-Item -ItemType Directory -Force -Path (Join-Path $env:TEMP "fixpm-install")
|
|
25
|
-
$exePath = Join-Path $tmp $Asset
|
|
26
|
-
$sumPath = Join-Path $tmp "$Asset.sha256"
|
|
27
|
-
|
|
28
|
-
Write-Host "downloading $Asset from $Base ..."
|
|
29
|
-
Invoke-WebRequest -Uri "$Base/$Asset" -OutFile $exePath -UseBasicParsing
|
|
30
|
-
Invoke-WebRequest -Uri "$Base/$Asset.sha256" -OutFile $sumPath -UseBasicParsing
|
|
31
|
-
|
|
32
|
-
$expected = (Get-Content $sumPath -Raw).Split(" ", 2)[0].Trim().ToLower()
|
|
33
|
-
$actual = (Get-FileHash $exePath -Algorithm SHA256).Hash.ToLower()
|
|
34
|
-
if ($expected -ne $actual) {
|
|
35
|
-
throw "sha256 mismatch for ${Asset}: expected $expected, got $actual"
|
|
36
|
-
}
|
|
37
|
-
Write-Host "checksum ok"
|
|
38
|
-
|
|
39
|
-
New-Item -ItemType Directory -Force -Path $DestDir | Out-Null
|
|
40
|
-
$installed = Join-Path $DestDir "fixpm.exe"
|
|
41
|
-
Copy-Item $exePath $installed -Force
|
|
42
|
-
Write-Host "installed: $installed"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
# fixpm installer for Windows PowerShell.
|
|
2
|
+
#
|
|
3
|
+
# One-line install:
|
|
4
|
+
# irm https://raw.githubusercontent.com/Max-code7997/fixpm/main/scripts/install.ps1 | iex
|
|
5
|
+
#
|
|
6
|
+
# Overrides (testing / mirrors):
|
|
7
|
+
# $env:FIXPM_RELEASE_BASE download base URL (default: latest GitHub release)
|
|
8
|
+
# $env:FIXPM_INSTALL_DIR target directory (default: $env:LOCALAPPDATA\fixpm\bin)
|
|
9
|
+
|
|
10
|
+
$ErrorActionPreference = "Stop"
|
|
11
|
+
$ProgressPreference = "SilentlyContinue" # Invoke-WebRequest is unusably slow with the progress bar
|
|
12
|
+
|
|
13
|
+
$Repo = "Max-code7997/fixpm"
|
|
14
|
+
$Base = if ($env:FIXPM_RELEASE_BASE) { $env:FIXPM_RELEASE_BASE }
|
|
15
|
+
else { "https://github.com/$Repo/releases/latest/download" }
|
|
16
|
+
$DestDir = if ($env:FIXPM_INSTALL_DIR) { $env:FIXPM_INSTALL_DIR }
|
|
17
|
+
else { Join-Path $env:LOCALAPPDATA "fixpm\bin" }
|
|
18
|
+
$Asset = "fixpm-windows-x64.exe"
|
|
19
|
+
|
|
20
|
+
# Older Windows PowerShell defaults to TLS 1.0, which GitHub rejects.
|
|
21
|
+
[Net.ServicePointManager]::SecurityProtocol = `
|
|
22
|
+
[Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
|
|
23
|
+
|
|
24
|
+
$tmp = New-Item -ItemType Directory -Force -Path (Join-Path $env:TEMP "fixpm-install")
|
|
25
|
+
$exePath = Join-Path $tmp $Asset
|
|
26
|
+
$sumPath = Join-Path $tmp "$Asset.sha256"
|
|
27
|
+
|
|
28
|
+
Write-Host "downloading $Asset from $Base ..."
|
|
29
|
+
Invoke-WebRequest -Uri "$Base/$Asset" -OutFile $exePath -UseBasicParsing
|
|
30
|
+
Invoke-WebRequest -Uri "$Base/$Asset.sha256" -OutFile $sumPath -UseBasicParsing
|
|
31
|
+
|
|
32
|
+
$expected = (Get-Content $sumPath -Raw).Split(" ", 2)[0].Trim().ToLower()
|
|
33
|
+
$actual = (Get-FileHash $exePath -Algorithm SHA256).Hash.ToLower()
|
|
34
|
+
if ($expected -ne $actual) {
|
|
35
|
+
throw "sha256 mismatch for ${Asset}: expected $expected, got $actual"
|
|
36
|
+
}
|
|
37
|
+
Write-Host "checksum ok"
|
|
38
|
+
|
|
39
|
+
New-Item -ItemType Directory -Force -Path $DestDir | Out-Null
|
|
40
|
+
$installed = Join-Path $DestDir "fixpm.exe"
|
|
41
|
+
Copy-Item $exePath $installed -Force
|
|
42
|
+
Write-Host "installed: $installed"
|
|
43
|
+
|
|
44
|
+
# The compiled probe is what the shell hook runs on the prompt path. Releases
|
|
45
|
+
# from 0.3.1 carry it; an older release has no such asset, which is a note
|
|
46
|
+
# rather than a failure — the hook falls back to the Python CLI.
|
|
47
|
+
$ProbeAsset = "fixpm-probe-windows-x64.exe"
|
|
48
|
+
$probePath = Join-Path $tmp $ProbeAsset
|
|
49
|
+
$probeSum = Join-Path $tmp "$ProbeAsset.sha256"
|
|
50
|
+
try {
|
|
51
|
+
Invoke-WebRequest -Uri "$Base/$ProbeAsset" -OutFile $probePath -UseBasicParsing
|
|
52
|
+
Invoke-WebRequest -Uri "$Base/$ProbeAsset.sha256" -OutFile $probeSum -UseBasicParsing
|
|
53
|
+
$probeExpected = (Get-Content $probeSum -Raw).Split(" ", 2)[0].Trim().ToLower()
|
|
54
|
+
$probeActual = (Get-FileHash $probePath -Algorithm SHA256).Hash.ToLower()
|
|
55
|
+
if ($probeExpected -ne $probeActual) { throw "sha256 mismatch for ${ProbeAsset}" }
|
|
56
|
+
$probeInstalled = Join-Path $DestDir "fixpm-probe.exe"
|
|
57
|
+
Copy-Item $probePath $probeInstalled -Force
|
|
58
|
+
Write-Host "installed: $probeInstalled (fast probe)"
|
|
59
|
+
} catch {
|
|
60
|
+
Write-Host "note: no fast probe installed ($($_.Exception.Message))"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
|
64
|
+
if (($userPath -split ";") -notcontains $DestDir) {
|
|
65
|
+
[Environment]::SetEnvironmentVariable("Path", "$userPath;$DestDir", "User")
|
|
66
|
+
Write-Host "added $DestDir to your user PATH - restart your terminal to pick it up"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
& $installed --version
|
|
@@ -1,79 +1,99 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
# fixpm installer for macOS / Linux.
|
|
3
|
-
#
|
|
4
|
-
# One-line install:
|
|
5
|
-
# curl -fsSL https://raw.githubusercontent.com/Max-code7997/fixpm/main/scripts/install.sh | sh
|
|
6
|
-
#
|
|
7
|
-
# Overrides (testing / mirrors):
|
|
8
|
-
# FIXPM_RELEASE_BASE download base URL (default: latest GitHub release)
|
|
9
|
-
# FIXPM_INSTALL_DIR target directory (default: ~/.local/bin)
|
|
10
|
-
# FIXPM_SKIP_VERSION_CHECK=1 don't execute the binary after install
|
|
11
|
-
set -eu
|
|
12
|
-
|
|
13
|
-
REPO="Max-code7997/fixpm"
|
|
14
|
-
BASE="${FIXPM_RELEASE_BASE:-https://github.com/$REPO/releases/latest/download}"
|
|
15
|
-
DEST="${FIXPM_INSTALL_DIR:-$HOME/.local/bin}"
|
|
16
|
-
|
|
17
|
-
case "$(uname -s)" in
|
|
18
|
-
Linux) platform="linux" ;;
|
|
19
|
-
Darwin) platform="macos" ;;
|
|
20
|
-
*) echo "error: unsupported platform '$(uname -s)'. On Windows use install.ps1." >&2; exit 1 ;;
|
|
21
|
-
esac
|
|
22
|
-
case "$(uname -m)" in
|
|
23
|
-
x86_64|amd64) arch="x64" ;;
|
|
24
|
-
arm64|aarch64) arch="arm64" ;;
|
|
25
|
-
*) echo "error: unsupported architecture '$(uname -m)'" >&2; exit 1 ;;
|
|
26
|
-
esac
|
|
27
|
-
ASSET="fixpm-${platform}-${arch}"
|
|
28
|
-
|
|
29
|
-
fetch() {
|
|
30
|
-
if command -v curl >/dev/null 2>&1; then
|
|
31
|
-
curl -fsSL --retry 3 -o "$2" "$1"
|
|
32
|
-
elif command -v wget >/dev/null 2>&1; then
|
|
33
|
-
wget -qO "$2" "$1"
|
|
34
|
-
else
|
|
35
|
-
echo "error: need curl or wget to download" >&2
|
|
36
|
-
exit 1
|
|
37
|
-
fi
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
TMP=$(mktemp -d)
|
|
41
|
-
trap 'rm -rf "$TMP"' EXIT
|
|
42
|
-
|
|
43
|
-
echo "downloading $ASSET from $BASE ..."
|
|
44
|
-
fetch "$BASE/$ASSET" "$TMP/$ASSET"
|
|
45
|
-
fetch "$BASE/$ASSET.sha256" "$TMP/$ASSET.sha256"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
echo "
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"$
|
|
79
|
-
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# fixpm installer for macOS / Linux.
|
|
3
|
+
#
|
|
4
|
+
# One-line install:
|
|
5
|
+
# curl -fsSL https://raw.githubusercontent.com/Max-code7997/fixpm/main/scripts/install.sh | sh
|
|
6
|
+
#
|
|
7
|
+
# Overrides (testing / mirrors):
|
|
8
|
+
# FIXPM_RELEASE_BASE download base URL (default: latest GitHub release)
|
|
9
|
+
# FIXPM_INSTALL_DIR target directory (default: ~/.local/bin)
|
|
10
|
+
# FIXPM_SKIP_VERSION_CHECK=1 don't execute the binary after install
|
|
11
|
+
set -eu
|
|
12
|
+
|
|
13
|
+
REPO="Max-code7997/fixpm"
|
|
14
|
+
BASE="${FIXPM_RELEASE_BASE:-https://github.com/$REPO/releases/latest/download}"
|
|
15
|
+
DEST="${FIXPM_INSTALL_DIR:-$HOME/.local/bin}"
|
|
16
|
+
|
|
17
|
+
case "$(uname -s)" in
|
|
18
|
+
Linux) platform="linux" ;;
|
|
19
|
+
Darwin) platform="macos" ;;
|
|
20
|
+
*) echo "error: unsupported platform '$(uname -s)'. On Windows use install.ps1." >&2; exit 1 ;;
|
|
21
|
+
esac
|
|
22
|
+
case "$(uname -m)" in
|
|
23
|
+
x86_64|amd64) arch="x64" ;;
|
|
24
|
+
arm64|aarch64) arch="arm64" ;;
|
|
25
|
+
*) echo "error: unsupported architecture '$(uname -m)'" >&2; exit 1 ;;
|
|
26
|
+
esac
|
|
27
|
+
ASSET="fixpm-${platform}-${arch}"
|
|
28
|
+
|
|
29
|
+
fetch() {
|
|
30
|
+
if command -v curl >/dev/null 2>&1; then
|
|
31
|
+
curl -fsSL --retry 3 -o "$2" "$1"
|
|
32
|
+
elif command -v wget >/dev/null 2>&1; then
|
|
33
|
+
wget -qO "$2" "$1"
|
|
34
|
+
else
|
|
35
|
+
echo "error: need curl or wget to download" >&2
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
TMP=$(mktemp -d)
|
|
41
|
+
trap 'rm -rf "$TMP"' EXIT
|
|
42
|
+
|
|
43
|
+
echo "downloading $ASSET from $BASE ..."
|
|
44
|
+
fetch "$BASE/$ASSET" "$TMP/$ASSET"
|
|
45
|
+
fetch "$BASE/$ASSET.sha256" "$TMP/$ASSET.sha256"
|
|
46
|
+
|
|
47
|
+
# compare <file> against a "<sha256> <name>" checksum file; 1 on mismatch
|
|
48
|
+
verify_checksum() {
|
|
49
|
+
expected=$(cut -d' ' -f1 "$2" | tr -d "[:space:]")
|
|
50
|
+
if command -v sha256sum >/dev/null 2>&1; then
|
|
51
|
+
actual=$(sha256sum "$1" | cut -d' ' -f1)
|
|
52
|
+
elif command -v shasum >/dev/null 2>&1; then
|
|
53
|
+
actual=$(shasum -a 256 "$1" | cut -d' ' -f1)
|
|
54
|
+
else
|
|
55
|
+
return 1
|
|
56
|
+
fi
|
|
57
|
+
[ "$expected" = "$actual" ]
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if ! verify_checksum "$TMP/$ASSET" "$TMP/$ASSET.sha256"; then
|
|
61
|
+
echo "error: sha256 mismatch for $ASSET" >&2
|
|
62
|
+
echo " (or no sha256sum/shasum available to verify it)" >&2
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
echo "checksum ok"
|
|
66
|
+
|
|
67
|
+
mkdir -p "$DEST"
|
|
68
|
+
cp "$TMP/$ASSET" "$DEST/fixpm"
|
|
69
|
+
chmod 0755 "$DEST/fixpm"
|
|
70
|
+
echo "installed: $DEST/fixpm"
|
|
71
|
+
|
|
72
|
+
# The compiled probe is what the shell hook runs on the prompt path. Releases
|
|
73
|
+
# from 0.3.1 carry it; an older release simply has no such asset, which is a
|
|
74
|
+
# note rather than a failure — the hook falls back to the Python CLI.
|
|
75
|
+
PROBE="fixpm-probe-${platform}-${arch}"
|
|
76
|
+
if fetch "$BASE/$PROBE" "$TMP/$PROBE" 2>/dev/null \
|
|
77
|
+
&& fetch "$BASE/$PROBE.sha256" "$TMP/$PROBE.sha256" 2>/dev/null; then
|
|
78
|
+
if verify_checksum "$TMP/$PROBE" "$TMP/$PROBE.sha256"; then
|
|
79
|
+
cp "$TMP/$PROBE" "$DEST/fixpm-probe"
|
|
80
|
+
chmod 0755 "$DEST/fixpm-probe"
|
|
81
|
+
echo "installed: $DEST/fixpm-probe (fast probe)"
|
|
82
|
+
else
|
|
83
|
+
echo "warning: probe checksum mismatch - skipping it" >&2
|
|
84
|
+
fi
|
|
85
|
+
else
|
|
86
|
+
echo "note: this release has no probe asset; the hook will use the Python CLI"
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
case ":$PATH:" in
|
|
90
|
+
*":$DEST:"*) ;;
|
|
91
|
+
*) echo "note: $DEST is not on your PATH."
|
|
92
|
+
echo " add it: export PATH=\"$DEST:\$PATH\" (put this line in ~/.bashrc or ~/.zshrc)" ;;
|
|
93
|
+
esac
|
|
94
|
+
|
|
95
|
+
if [ "${FIXPM_SKIP_VERSION_CHECK:-0}" = "1" ]; then
|
|
96
|
+
echo "(version check skipped)"
|
|
97
|
+
else
|
|
98
|
+
"$DEST/fixpm" --version
|
|
99
|
+
fi
|
fixpm-0.3.0/go/go.mod
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|