You've already forked AstralRinth
forked from didirus/AstralRinth
devex: i18n coverage (#4991)
* devex: i18n coverage * feat: chalk usage * feat: exclude legal
This commit is contained in:
24
scripts/run.mjs
Normal file
24
scripts/run.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
import { spawn } from 'child_process'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { dirname, join } from 'path'
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
const [scriptName, ...args] = process.argv.slice(2)
|
||||
|
||||
if (!scriptName) {
|
||||
console.error('Usage: pnpm scripts <script-name> [args...]')
|
||||
console.error('Example: pnpm scripts coverage-i18n --verbose')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const scriptPath = join(__dirname, `${scriptName}.ts`)
|
||||
|
||||
const child = spawn('pnpx', ['tsx', scriptPath, ...args], {
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
})
|
||||
|
||||
child.on('exit', (code) => {
|
||||
process.exit(code ?? 0)
|
||||
})
|
||||
Reference in New Issue
Block a user