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.
Files changed (59) hide show
  1. {fixpm-0.3.0 → fixpm-0.3.2}/.github/workflows/ci.yml +42 -1
  2. {fixpm-0.3.0 → fixpm-0.3.2}/.github/workflows/release.yml +106 -74
  3. {fixpm-0.3.0 → fixpm-0.3.2}/PKG-INFO +12 -3
  4. {fixpm-0.3.0 → fixpm-0.3.2}/README.md +11 -2
  5. {fixpm-0.3.0 → fixpm-0.3.2}/bucket/fixpm.json +4 -4
  6. fixpm-0.3.2/go/go.mod +8 -0
  7. {fixpm-0.3.0 → fixpm-0.3.2}/go/rules_gen.go +2 -2
  8. {fixpm-0.3.0 → fixpm-0.3.2}/packaging/homebrew-fixpm/Formula/fixpm.rb +74 -74
  9. {fixpm-0.3.0 → fixpm-0.3.2}/packaging/homebrew-fixpm/README.md +86 -86
  10. {fixpm-0.3.0 → fixpm-0.3.2}/scripts/install.ps1 +69 -50
  11. {fixpm-0.3.0 → fixpm-0.3.2}/scripts/install.sh +99 -79
  12. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/__init__.py +1 -1
  13. fixpm-0.3.0/go/go.mod +0 -3
  14. {fixpm-0.3.0 → fixpm-0.3.2}/.gitignore +0 -0
  15. {fixpm-0.3.0 → fixpm-0.3.2}/LICENSE +0 -0
  16. {fixpm-0.3.0 → fixpm-0.3.2}/fixpm.spec +0 -0
  17. {fixpm-0.3.0 → fixpm-0.3.2}/go/corrector.go +0 -0
  18. {fixpm-0.3.0 → fixpm-0.3.2}/go/detector.go +0 -0
  19. {fixpm-0.3.0 → fixpm-0.3.2}/go/distance.go +0 -0
  20. {fixpm-0.3.0 → fixpm-0.3.2}/go/main.go +0 -0
  21. {fixpm-0.3.0 → fixpm-0.3.2}/go/packages.go +0 -0
  22. {fixpm-0.3.0 → fixpm-0.3.2}/go/parity_test.go +0 -0
  23. {fixpm-0.3.0 → fixpm-0.3.2}/go/pymath.go +0 -0
  24. {fixpm-0.3.0 → fixpm-0.3.2}/go/rules.go +0 -0
  25. {fixpm-0.3.0 → fixpm-0.3.2}/go/shlex.go +0 -0
  26. {fixpm-0.3.0 → fixpm-0.3.2}/go/testdata/parity.json +0 -0
  27. {fixpm-0.3.0 → fixpm-0.3.2}/go/util.go +0 -0
  28. {fixpm-0.3.0 → fixpm-0.3.2}/pyproject.toml +0 -0
  29. {fixpm-0.3.0 → fixpm-0.3.2}/scripts/gen_go_rules.py +0 -0
  30. {fixpm-0.3.0 → fixpm-0.3.2}/scripts/gen_parity_vectors.py +0 -0
  31. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/__main__.py +0 -0
  32. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/cli.py +0 -0
  33. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/corrector.py +0 -0
  34. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/detector.py +0 -0
  35. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/distance.py +0 -0
  36. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/interactive.py +0 -0
  37. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/packages.py +0 -0
  38. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/__init__.py +0 -0
  39. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/base.py +0 -0
  40. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/cargo.py +0 -0
  41. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/docker.py +0 -0
  42. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/git.py +0 -0
  43. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/go.py +0 -0
  44. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/npm.py +0 -0
  45. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/npx.py +0 -0
  46. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/pip.py +0 -0
  47. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/pnpm.py +0 -0
  48. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/rules/yarn.py +0 -0
  49. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/__init__.py +0 -0
  50. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/fixpm.bash +0 -0
  51. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/fixpm.ps1 +0 -0
  52. {fixpm-0.3.0 → fixpm-0.3.2}/src/fixpm/shell/fixpm.zsh +0 -0
  53. {fixpm-0.3.0 → fixpm-0.3.2}/tests/conftest.py +0 -0
  54. {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_cli_doctor.py +0 -0
  55. {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_cli_hook_init.py +0 -0
  56. {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_corrections.py +0 -0
  57. {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_distance.py +0 -0
  58. {fixpm-0.3.0 → fixpm-0.3.2}/tests/test_interactive.py +0 -0
  59. {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: "1.22"
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
- - os: ubuntu-latest
19
- artifact: fixpm-linux-x64
20
- - os: macos-latest
21
- artifact: fixpm-macos-arm64
22
- # note: macos-13 (intel) matrix entry removed — the runner label is
23
- # effectively retired and queued forever; arm64 covers modern Macs.
24
- runs-on: ${{ matrix.os }}
25
- steps:
26
- - uses: actions/checkout@v4
27
-
28
- - uses: actions/setup-python@v5
29
- with:
30
- python-version: "3.12"
31
-
32
- - name: Install
33
- run: |
34
- python -m pip install --upgrade pip
35
- pip install . pyinstaller
36
-
37
- - name: Build single-file executable
38
- run: pyinstaller --onefile --name fixpm --paths src src/fixpm/__main__.py
39
-
40
- - name: Rename artifact
41
- shell: bash
42
- run: |
43
- cd dist
44
- if [ -f fixpm.exe ]; then mv fixpm.exe "${{ matrix.artifact }}"; fi
45
- if [ -f fixpm ] && [ ! -f "${{ matrix.artifact }}" ]; then mv fixpm "${{ matrix.artifact }}"; fi
46
- ls -la
47
-
48
- - name: Generate sha256 checksum
49
- shell: bash
50
- run: |
51
- cd dist
52
- sha256sum "${{ matrix.artifact }}" > "${{ matrix.artifact }}.sha256"
53
- cat "${{ matrix.artifact }}.sha256"
54
-
55
- - uses: actions/upload-artifact@v4
56
- with:
57
- name: ${{ matrix.artifact }}
58
- path: dist/${{ matrix.artifact }}*
59
-
60
- release:
61
- needs: build
62
- runs-on: ubuntu-latest
63
- steps:
64
- - name: Download all artifacts
65
- uses: actions/download-artifact@v4
66
- with:
67
- path: release
68
- merge-multiple: true
69
-
70
- - name: Attach to GitHub Release
71
- uses: softprops/action-gh-release@v2
72
- with:
73
- files: release/*
74
- generate_release_notes: true
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.0
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
- cd go && go build -ldflags="-s -w" -o fixpm-probe.exe . # or: go build .
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
- cd go && go build -ldflags="-s -w" -o fixpm-probe.exe . # or: go build .
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.2.1",
3
- "description": "Interactive fixer for broken npm / npx / pnpm / yarn commands.",
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.2.1/fixpm-windows-x64.exe",
9
- "hash": "35c943f430c71a3491720686dfbbf7afed1e28ff033f979c613cf8a4e45a7b0a"
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.0"
9
+ const version = "0.3.2"
10
10
 
11
11
  // userAgent mirrors fixpm.packages.USER_AGENT.
12
- const userAgent = "fixpm/0.3.0 (+https://github.com/Max-code7997/fixpm)"
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 broken npm / npx / pnpm / yarn commands"
5
- homepage "https://github.com/Max-code7997/fixpm"
6
- url "https://files.pythonhosted.org/packages/ae/c6/ab745a01aa90cfda8ff87894f264160f2384a4a0c3f1001960b200275ae7/fixpm-0.2.1.tar.gz"
7
- sha256 "2076ef59762e8decc168a3499e386e0e00397734840af5d93f4b665522323c56"
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/ae/40/4a3db7990d1f62a53182aa96eaef57aeb2886a27f90a195bc66713565d31/typer-0.27.1.tar.gz"
59
- sha256 "a79bef8469a79c45498e7b814ecf8d603cc7644e9acbd9e19cac0334240b18df"
60
- end
61
-
62
- resource "wcwidth" do
63
- url "https://files.pythonhosted.org/packages/34/74/c6428f875774288bec1396f5bfcbc2d925700a4dad61727fd5f2b12f249d/wcwidth-0.8.2.tar.gz"
64
- sha256 "91fbef97204b96a3d4d421609b80340b760cf33e26da123ff243d76b1fda8dda"
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 broken npm / npx / pnpm / yarn commands.
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
- $userPath = [Environment]::GetEnvironmentVariable("Path", "User")
45
- if (($userPath -split ";") -notcontains $DestDir) {
46
- [Environment]::SetEnvironmentVariable("Path", "$userPath;$DestDir", "User")
47
- Write-Host "added $DestDir to your user PATH - restart your terminal to pick it up"
48
- }
49
-
50
- & $installed --version
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
- expected=$(cut -d' ' -f1 "$TMP/$ASSET.sha256" | tr -d "[:space:]")
48
- if command -v sha256sum >/dev/null 2>&1; then
49
- actual=$(sha256sum "$TMP/$ASSET" | cut -d' ' -f1)
50
- elif command -v shasum >/dev/null 2>&1; then
51
- actual=$(shasum -a 256 "$TMP/$ASSET" | cut -d' ' -f1)
52
- else
53
- echo "error: no sha256sum/shasum available for checksum verification" >&2
54
- exit 1
55
- fi
56
- if [ "$expected" != "$actual" ]; then
57
- echo "error: sha256 mismatch for $ASSET" >&2
58
- echo " expected: $expected" >&2
59
- echo " actual: $actual" >&2
60
- exit 1
61
- fi
62
- echo "checksum ok"
63
-
64
- mkdir -p "$DEST"
65
- cp "$TMP/$ASSET" "$DEST/fixpm"
66
- chmod 0755 "$DEST/fixpm"
67
- echo "installed: $DEST/fixpm"
68
-
69
- case ":$PATH:" in
70
- *":$DEST:"*) ;;
71
- *) echo "note: $DEST is not on your PATH."
72
- echo " add it: export PATH=\"$DEST:\$PATH\" (put this line in ~/.bashrc or ~/.zshrc)" ;;
73
- esac
74
-
75
- if [ "${FIXPM_SKIP_VERSION_CHECK:-0}" = "1" ]; then
76
- echo "(version check skipped)"
77
- else
78
- "$DEST/fixpm" --version
79
- fi
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
@@ -1,3 +1,3 @@
1
1
  """fixpm — interactive command fixer for npm, git, docker, cargo, pip and go."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.3.2"
fixpm-0.3.0/go/go.mod DELETED
@@ -1,3 +0,0 @@
1
- module github.com/Max-code7997/fixpm/go
2
-
3
- go 1.22
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