feat: allow passing args to install (#87)

This commit is contained in:
jdx 2024-06-01 16:10:28 +00:00 committed by GitHub
parent 1f3aa7e010
commit 5f5bc9d57c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 20 additions and 5 deletions

View file

@ -53,6 +53,7 @@ jobs:
cache_save: ${{ github.ref_name == 'main' }}
cache_key_prefix: mise-v1
version: 2024.1.6
install_args: bun
mise_toml: |
[tools]
bun = "1"

View file

@ -18,6 +18,7 @@ jobs:
with:
version: 2023.12.0 # [default: latest] mise version to 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
# automatically write this .tool-versions file
experimental: true # [default: false] enable experimental features

View file

@ -24,6 +24,9 @@ inputs:
required: false
default: "true"
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:
required: false
default: "true"

9
dist/index.js generated vendored
View file

@ -80256,12 +80256,17 @@ function getOS() {
}
}
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 cwd = core.getInput('working_directory') ||
core.getInput('install_dir') ||
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 () => {
core.info(`Body:\n${body}`);

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -126,14 +126,19 @@ function getOS(): string {
}
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> =>
core.group(`Running mise ${args.join(' ')}`, async () => {
const cwd =
core.getInput('working_directory') ||
core.getInput('install_dir') ||
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> =>