Scaffold --force wip

This commit is contained in:
Lucas Bustamante 2022-01-26 13:13:18 -03:00
parent 27eba955dd
commit cac95a3433
1 changed files with 24 additions and 10 deletions

View File

@ -24,25 +24,39 @@ const {
} = require( '../utils/scaffold' ); } = require( '../utils/scaffold' );
const args = process.argv.slice( 2 ); const args = process.argv.slice( 2 );
const [ command, packageName ] = args;
const command = args[0];
let packageName = null;
if (args[1].substr(0, 2) !== '--') {
packageName = args[1];
}
// Allow multiple spec file extensions and formats. // Allow multiple spec file extensions and formats.
let testExtension = 'test.js'; let testExtension = 'test.js';
let testFormat = ''; let testFormat = '';
for ( let a = 2; a < args.length; a++ ) { let force = false;
const nextArg = a + 1;
if ( nextArg >= args.length ) { args.forEach((el) => {
break; console.log(el);
} switch ( el ) {
switch ( args[ a ] ) {
case '--format': case '--format':
testFormat = args[ nextArg ]; testFormat = el;
break; break;
case '--ext': case '--ext':
testExtension = args[ nextArg ]; testExtension = el;
break;
case '--force':
force = true;
break; break;
} }
} });
console.log('Command: ' + command );
console.log('Package Name: ' + packageName );
console.log('Test Extension: ' + testExtension );
console.log('Test Format: ' + testFormat );
/** /**
* Install the test scripts and sample default.json configuration * Install the test scripts and sample default.json configuration