feat: allow passing args to install (#87)
This commit is contained in:
parent
1f3aa7e010
commit
5f5bc9d57c
6 changed files with 20 additions and 5 deletions
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
|
@ -53,6 +53,7 @@ jobs:
|
||||||
cache_save: ${{ github.ref_name == 'main' }}
|
cache_save: ${{ github.ref_name == 'main' }}
|
||||||
cache_key_prefix: mise-v1
|
cache_key_prefix: mise-v1
|
||||||
version: 2024.1.6
|
version: 2024.1.6
|
||||||
|
install_args: bun
|
||||||
mise_toml: |
|
mise_toml: |
|
||||||
[tools]
|
[tools]
|
||||||
bun = "1"
|
bun = "1"
|
||||||
|
|
|
@ -18,6 +18,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
version: 2023.12.0 # [default: latest] mise version to install
|
version: 2023.12.0 # [default: latest] mise version to install
|
||||||
install: true # [default: true] run `mise install`
|
install: true # [default: true] run `mise install`
|
||||||
|
install_args: "bun" # [default: ""] additional arguments to `mise install`
|
||||||
cache: true # [default: true] cache mise using GitHub's cache
|
cache: true # [default: true] cache mise using GitHub's cache
|
||||||
# automatically write this .tool-versions file
|
# automatically write this .tool-versions file
|
||||||
experimental: true # [default: false] enable experimental features
|
experimental: true # [default: false] enable experimental features
|
||||||
|
|
|
@ -24,6 +24,9 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: "true"
|
default: "true"
|
||||||
description: if false, will not run `mise install`
|
description: if false, will not run `mise install`
|
||||||
|
install_args:
|
||||||
|
required: false
|
||||||
|
description: Arguments to pass to `mise install` such as "bun" to only install bun
|
||||||
cache:
|
cache:
|
||||||
required: false
|
required: false
|
||||||
default: "true"
|
default: "true"
|
||||||
|
|
9
dist/index.js
generated
vendored
9
dist/index.js
generated
vendored
|
@ -80256,12 +80256,17 @@ function getOS() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const testMise = async () => mise(['--version']);
|
const testMise = async () => mise(['--version']);
|
||||||
const miseInstall = async () => mise(['install']);
|
const miseInstall = async () => mise([`install ${core.getInput('install_args')}`]);
|
||||||
const mise = async (args) => core.group(`Running mise ${args.join(' ')}`, async () => {
|
const mise = async (args) => core.group(`Running mise ${args.join(' ')}`, async () => {
|
||||||
const cwd = core.getInput('working_directory') ||
|
const cwd = core.getInput('working_directory') ||
|
||||||
core.getInput('install_dir') ||
|
core.getInput('install_dir') ||
|
||||||
process.cwd();
|
process.cwd();
|
||||||
return exec.exec('mise', args, { cwd });
|
if (args.length === 1) {
|
||||||
|
return exec.exec(`mise ${args}`, [], { cwd });
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return exec.exec('mise', args, { cwd });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const writeFile = async (p, body) => core.group(`Writing ${p}`, async () => {
|
const writeFile = async (p, body) => core.group(`Writing ${p}`, async () => {
|
||||||
core.info(`Body:\n${body}`);
|
core.info(`Body:\n${body}`);
|
||||||
|
|
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
@ -126,14 +126,19 @@ function getOS(): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
const testMise = async (): Promise<number> => mise(['--version'])
|
const testMise = async (): Promise<number> => mise(['--version'])
|
||||||
const miseInstall = async (): Promise<number> => mise(['install'])
|
const miseInstall = async (): Promise<number> =>
|
||||||
|
mise([`install ${core.getInput('install_args')}`])
|
||||||
const mise = async (args: string[]): Promise<number> =>
|
const mise = async (args: string[]): Promise<number> =>
|
||||||
core.group(`Running mise ${args.join(' ')}`, async () => {
|
core.group(`Running mise ${args.join(' ')}`, async () => {
|
||||||
const cwd =
|
const cwd =
|
||||||
core.getInput('working_directory') ||
|
core.getInput('working_directory') ||
|
||||||
core.getInput('install_dir') ||
|
core.getInput('install_dir') ||
|
||||||
process.cwd()
|
process.cwd()
|
||||||
return exec.exec('mise', args, { cwd })
|
if (args.length === 1) {
|
||||||
|
return exec.exec(`mise ${args}`, [], { cwd })
|
||||||
|
} else {
|
||||||
|
return exec.exec('mise', args, { cwd })
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const writeFile = async (p: fs.PathLike, body: string): Promise<void> =>
|
const writeFile = async (p: fs.PathLike, body: string): Promise<void> =>
|
||||||
|
|
Loading…
Add table
Reference in a new issue