Skip to content

Commit

Permalink
feat: allow passing args to install (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Jun 1, 2024
1 parent 1f3aa7e commit 5f5bc9d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> =>
Expand Down

0 comments on commit 5f5bc9d

Please sign in to comment.