update README & npm run all

This commit is contained in:
Naoki Oketani
2020-11-12 10:45:24 +00:00
parent 56422b6d5a
commit 3868af0215
5 changed files with 22 additions and 18 deletions

View File

@@ -9,20 +9,16 @@ export class Audit {
public run(auditLevel: string, productionFlag: string): void {
try {
const auditOptions: Array<string> =['audit', '--audit-level', auditLevel];
if(productionFlag === 'true') {
auditOptions.push('--production');
const auditOptions: Array<string> = ['audit', '--audit-level', auditLevel]
if (productionFlag === 'true') {
auditOptions.push('--production')
}
const result: SpawnSyncReturns<string> = spawnSync(
'npm',
auditOptions,
{
encoding: 'utf-8',
maxBuffer: SPAWN_PROCESS_BUFFER_SIZE
}
)
const result: SpawnSyncReturns<string> = spawnSync('npm', auditOptions, {
encoding: 'utf-8',
maxBuffer: SPAWN_PROCESS_BUFFER_SIZE
})
if (result.error) {
throw result.error

View File

@@ -25,7 +25,7 @@ export async function run(): Promise<void> {
throw new Error('Invalid input: audit_level')
}
const productionFlag = core.getInput('production_flag', {required: false});
const productionFlag = core.getInput('production_flag', {required: false})
if (!['true', 'false'].includes(productionFlag)) {
throw new Error('Invalid input: production_flag')
}