@arvoretech/hub 0.8.0 → 0.8.1
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/dist/index.js +18 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3102,7 +3102,7 @@ async function syncAssets(hubDir, assets) {
|
|
|
3102
3102
|
}
|
|
3103
3103
|
}
|
|
3104
3104
|
}
|
|
3105
|
-
var scanCommand = new Command18("scan").description("Detect git repositories not registered in hub.yaml").option("-y, --yes", "Auto-add all found repos without prompting").action(async (opts) => {
|
|
3105
|
+
var scanCommand = new Command18("scan").description("Detect git repositories not registered in hub.yaml").option("-y, --yes", "Auto-add all found repos without prompting").option("--check", "Check for unsynced assets without prompting (exit code 1 if found)").action(async (opts) => {
|
|
3106
3106
|
const hubDir = process.cwd();
|
|
3107
3107
|
const configPath = join17(hubDir, "hub.yaml");
|
|
3108
3108
|
if (!existsSync14(configPath)) {
|
|
@@ -3111,6 +3111,23 @@ var scanCommand = new Command18("scan").description("Detect git repositories not
|
|
|
3111
3111
|
}
|
|
3112
3112
|
const content = await readFile8(configPath, "utf-8");
|
|
3113
3113
|
const config = parse2(content);
|
|
3114
|
+
if (opts.check) {
|
|
3115
|
+
const unregistered2 = await findUnregisteredRepos(hubDir, config);
|
|
3116
|
+
const unsyncedAssets2 = await findUnsyncedAssets(hubDir);
|
|
3117
|
+
const total = unregistered2.length + unsyncedAssets2.length;
|
|
3118
|
+
if (total > 0) {
|
|
3119
|
+
if (unregistered2.length > 0) {
|
|
3120
|
+
console.log(chalk18.yellow(`Found ${unregistered2.length} unregistered repo(s): ${unregistered2.join(", ")}`));
|
|
3121
|
+
}
|
|
3122
|
+
if (unsyncedAssets2.length > 0) {
|
|
3123
|
+
console.log(chalk18.yellow(`Found ${unsyncedAssets2.length} unsynced asset(s): ${unsyncedAssets2.map((a) => a.name).join(", ")}`));
|
|
3124
|
+
}
|
|
3125
|
+
console.log(chalk18.yellow("Run 'hub scan' to sync."));
|
|
3126
|
+
process.exit(1);
|
|
3127
|
+
}
|
|
3128
|
+
console.log(chalk18.green("All repos and assets are synced."));
|
|
3129
|
+
return;
|
|
3130
|
+
}
|
|
3114
3131
|
let hasChanges = false;
|
|
3115
3132
|
console.log(chalk18.blue("\nScanning for unregistered repositories...\n"));
|
|
3116
3133
|
const unregistered = await findUnregisteredRepos(hubDir, config);
|