Skip to content

Commit

Permalink
fix: respect frozen/locked inputs for pixi list (#94)
Browse files Browse the repository at this point in the history
Co-authored-by: Pavel Zwerschke <[email protected]>
  • Loading branch information
wpbonelli and pavelzw authored Apr 11, 2024
1 parent 92e1dd3 commit 42f9edd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ jobs:
- uses: ./
with:
cache: false
pixi-url: https://github.com/prefix-dev/pixi/releases/download/v0.13.0/pixi-x86_64-unknown-linux-musl
- run: pixi --version | grep -q "pixi 0.13.0"
pixi-url: https://github.com/prefix-dev/pixi/releases/download/v0.14.0/pixi-x86_64-unknown-linux-musl
- run: pixi --version | grep -q "pixi 0.14.0"

custom-manifest-path:
strategy:
Expand Down
13 changes: 11 additions & 2 deletions dist/index.js

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

15 changes: 13 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,25 @@ const generateList = async () => {
)
return Promise.resolve()
}
let command = 'list'
if (
'version' in options.pixiSource &&
options.pixiSource.version !== 'latest' &&
options.pixiSource.version < 'v0.14.0'
) {
if (options.frozen) core.warning('pixi versions < `v0.14.0` do not support the --frozen option for pixi list.')
if (options.locked) core.warning('pixi versions < `v0.14.0` do not support the --locked option for pixi list.')
} else {
command = `${command}${options.frozen ? ' --frozen' : ''}${options.locked ? ' --locked' : ''}`
}
if (options.environments) {
for (const environment of options.environments) {
core.debug(`Listing environment ${environment}`)
await core.group(`pixi list -e ${environment}`, () => execute(pixiCmd(`list -e ${environment}`)))
await core.group(`pixi ${command} -e ${environment}`, () => execute(pixiCmd(`${command} -e ${environment}`)))
}
return Promise.resolve()
} else {
return core.group('pixi list', () => execute(pixiCmd('list')))
return core.group(`pixi ${command}`, () => execute(pixiCmd(command)))
}
}

Expand Down

0 comments on commit 42f9edd

Please sign in to comment.