Skip to content

Commit 74e9995

Browse files
feat(uv): replace pipx with uv (#27)
Signed-off-by: Shigure Kurosaki <shigure@hqsy.net>
1 parent b21ff42 commit 74e9995

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/installer.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type FormatterKey, type LinterKey } from './map'
44

55
export type CommitLinter = 'commitlint' | 'commitlint_config_conventional'
66

7-
type PM = 'npm' | 'rustup' | 'cargo' | 'pipx' | 'docker'
7+
type PM = 'npm' | 'rustup' | 'cargo' | 'uv' | 'docker'
88

99
type Setups = Record<PM, string[]>
1010

@@ -17,6 +17,9 @@ type Tools = Record<
1717
}
1818
>
1919

20+
// NOTE:
21+
// The `#!/bin/sh` in the install scripts for
22+
// `cargo-binstall` and `uv` doesn't actually work.
2023
export async function installer(
2124
name: CommitLinter | FormatterKey | LinterKey,
2225
version: string,
@@ -30,12 +33,12 @@ export async function installer(
3033
`rustup toolchain install ${version} --profile minimal`,
3134
`rustup default ${version}`,
3235
],
33-
// NOTE: `#!/bin/sh` not found.
3436
cargo: [
3537
'curl -fsSL https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | sh',
3638
],
37-
// NOTE: Permission denied.
38-
pipx: ['sudo chown -R "$(whoami)" /opt/pipx/venvs/yamllint'],
39+
uv: [
40+
'curl -fsSL https://github.com/astral-sh/uv/releases/latest/download/uv-installer.sh | sh',
41+
],
3942
docker: [],
4043
}
4144

@@ -91,13 +94,9 @@ export async function installer(
9194
],
9295
},
9396
yamllint: {
94-
pm: 'pipx',
95-
setup: setups.pipx,
96-
cmd: [
97-
'install',
98-
'--force',
99-
version === 'latest' ? 'yamllint' : `yamllint==${version}`,
100-
],
97+
pm: 'uv',
98+
setup: setups.uv,
99+
cmd: ['tool', 'install', `yamllint@${version}`],
101100
},
102101
actionlint: {
103102
pm: 'docker',

0 commit comments

Comments
 (0)