regressify 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +6 -4
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -45,9 +45,11 @@ function runCommand(command) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const args = process.argv.slice(2);
|
|
48
|
+
const command = args[0].toLowerCase();
|
|
49
|
+
|
|
48
50
|
let commandBase = `tsx ${getLibraryPath()}/src/index.ts`;
|
|
49
51
|
|
|
50
|
-
if (
|
|
52
|
+
if (command === 'init') {
|
|
51
53
|
const __filename = fileURLToPath(import.meta.url);
|
|
52
54
|
const __dirname = dirname(__filename);
|
|
53
55
|
const postInstallPath = pathToFileURL(path.join(__dirname, 'generate_tests.js'));
|
|
@@ -57,15 +59,15 @@ if (args[0] === 'init') {
|
|
|
57
59
|
} else {
|
|
58
60
|
console.log(chalk.red('generate_tests.js not found!'));
|
|
59
61
|
}
|
|
60
|
-
} else if (
|
|
62
|
+
} else if (command === 'ref') {
|
|
61
63
|
const command = `${commandBase} --command test --ref ${args.slice(1).join(' ')}`;
|
|
62
64
|
console.log(chalk.yellow(`Running command: ${command}`));
|
|
63
65
|
runCommand(command);
|
|
64
|
-
} else if (
|
|
66
|
+
} else if (command === 'approve') {
|
|
65
67
|
const command = `${commandBase} --command approve ${args.slice(1).join(' ')}`;
|
|
66
68
|
console.log(chalk.yellow(`Running command: ${command}`));
|
|
67
69
|
runCommand(command);
|
|
68
|
-
} else if (
|
|
70
|
+
} else if (command === 'test') {
|
|
69
71
|
const command = `${commandBase} --command test ${args.slice(1).join(' ')}`;
|
|
70
72
|
console.log(chalk.yellow(`Running command: ${command}`));
|
|
71
73
|
runCommand(command);
|