@annexfour/cli 1.0.2 → 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/bin/index.js +20 -4
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -57,6 +57,8 @@ program
|
|
|
57
57
|
.option('-t, --token <token>', 'API Token (overrides config)')
|
|
58
58
|
.option('-p, --project-name <name>', 'Project Name')
|
|
59
59
|
.action(async (targetPath, options) => {
|
|
60
|
+
const scanPath = targetPath ? path.resolve(targetPath) : process.cwd();
|
|
61
|
+
|
|
60
62
|
// 1. Check for Docker
|
|
61
63
|
try {
|
|
62
64
|
await new Promise((resolve, reject) => {
|
|
@@ -83,7 +85,21 @@ program
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
// 3. Project Name (Required for authenticated scans)
|
|
89
|
+
const projectName = options.projectName;
|
|
90
|
+
let finalProjectName = projectName;
|
|
91
|
+
|
|
92
|
+
if (!finalProjectName) {
|
|
93
|
+
const projectAnswer = await inquirer.prompt([
|
|
94
|
+
{
|
|
95
|
+
type: 'input',
|
|
96
|
+
name: 'name',
|
|
97
|
+
message: 'Project Name:',
|
|
98
|
+
default: path.basename(scanPath)
|
|
99
|
+
}
|
|
100
|
+
]);
|
|
101
|
+
finalProjectName = projectAnswer.name;
|
|
102
|
+
}
|
|
87
103
|
|
|
88
104
|
// Construct Docker arguments
|
|
89
105
|
const dockerArgs = [
|
|
@@ -102,9 +118,9 @@ program
|
|
|
102
118
|
if (options.token) {
|
|
103
119
|
dockerArgs.push('--token', options.token);
|
|
104
120
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
121
|
+
|
|
122
|
+
// Always pass project name now that we've ensured we have one
|
|
123
|
+
dockerArgs.push('--project-name', finalProjectName);
|
|
108
124
|
|
|
109
125
|
console.log(`[*] Launching Scanner via Docker...`);
|
|
110
126
|
// console.log(`DEBUG: docker ${dockerArgs.join(' ')}`);
|