mirror of
https://code.forgejo.org/pnpm/action-setup.git
synced 2025-06-15 08:21:12 +00:00
28 lines
582 B
TypeScript
28 lines
582 B
TypeScript
![]() |
import { spawnSync } from 'child_process'
|
||
|
import { setFailed } from '@actions/core'
|
||
|
import { Inputs } from '../inputs'
|
||
|
|
||
|
export function pruneStore(inputs: Inputs) {
|
||
|
if (inputs.runInstall.length === 0) {
|
||
|
console.log('Pruning is unnecessary.')
|
||
|
return
|
||
|
}
|
||
|
|
||
|
console.log('Running pnpm store prune')
|
||
|
const { error, status } = spawnSync('pnpm', ['store', 'prune'], {
|
||
|
stdio: 'inherit',
|
||
|
})
|
||
|
|
||
|
if (error) {
|
||
|
setFailed(error)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
if (status) {
|
||
|
setFailed(`command pnpm store prune exits with code ${status}`)
|
||
|
return
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default pruneStore
|