@misterhuydo/sentinel 1.0.10 → 1.0.12
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/.cairn/.hint-lock +1 -0
- package/.cairn/session.json +7 -0
- package/bin/sentinel.js +24 -2
- package/lib/generate.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2026-03-21T17:01:47.015Z
|
package/bin/sentinel.js
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
const chalk = require('chalk');
|
|
5
5
|
const [,, command = 'help', ...args] = process.argv;
|
|
6
6
|
|
|
7
|
+
// Handle flags before the main switch
|
|
8
|
+
if (command === '--version' || command === '-v') {
|
|
9
|
+
const { version } = require('../package.json');
|
|
10
|
+
console.log(version);
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
if (command === '--help' || command === '-h') {
|
|
14
|
+
printUsage();
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
|
|
7
18
|
const BANNER = `
|
|
8
19
|
${chalk.cyan('███████╗███████╗███╗ ██╗████████╗██╗███╗ ██╗███████╗██╗')}
|
|
9
20
|
${chalk.cyan('██╔════╝██╔════╝████╗ ██║╚══██╔══╝██║████╗ ██║██╔════╝██║')}
|
|
@@ -26,14 +37,25 @@ async function main() {
|
|
|
26
37
|
break;
|
|
27
38
|
case 'help':
|
|
28
39
|
default:
|
|
29
|
-
|
|
40
|
+
printUsage();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function printUsage() {
|
|
45
|
+
const { version } = require('../package.json');
|
|
46
|
+
console.log(`${chalk.bold('sentinel')} v${version} — Autonomous DevOps Agent
|
|
47
|
+
|
|
48
|
+
${chalk.bold('Usage:')}
|
|
30
49
|
sentinel init Interactive setup — install everything and create workspace
|
|
31
50
|
sentinel add <name> Add a blank project (fill config manually)
|
|
32
51
|
sentinel add <git-url> Add a project pre-configured for a GitHub repo
|
|
33
52
|
sentinel add <project.json> Add a project from a local JSON config file
|
|
34
53
|
sentinel add <https://host/cfg.json> Add a project from a remote JSON config URL
|
|
54
|
+
|
|
55
|
+
${chalk.bold('Options:')}
|
|
56
|
+
--version, -v Print version
|
|
57
|
+
--help, -h Print this help
|
|
35
58
|
`);
|
|
36
|
-
}
|
|
37
59
|
}
|
|
38
60
|
|
|
39
61
|
main().catch(err => {
|
package/lib/generate.js
CHANGED
|
@@ -112,7 +112,7 @@ for project_dir in "$WORKSPACE"/*/; do
|
|
|
112
112
|
|
|
113
113
|
# Must have at least one repo-config with a valid GitHub REPO_URL
|
|
114
114
|
valid_repo=false
|
|
115
|
-
for props in "$project_dir/config/repo-configs/"*.properties
|
|
115
|
+
for props in "$project_dir/config/repo-configs/"*.properties; do
|
|
116
116
|
[[ -f "$props" ]] || continue
|
|
117
117
|
if grep -qE "^REPO_URL[[:space:]]*=[[:space:]]*(git@github\.com:|https://github\.com/)" "$props"; then
|
|
118
118
|
valid_repo=true
|