create-svc 0.1.68 → 0.1.69
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import { mkdir, readdir } from "node:fs/promises";
|
|
3
|
+
import { mkdir, readdir, stat } from "node:fs/promises";
|
|
4
4
|
import { ensureAuthClient, ensureAuthResourceServer, runAuthCommand, runAuthDoctor } from "../authctl";
|
|
5
5
|
import { stopLocalDev } from "../local-dev";
|
|
6
6
|
import { bootstrap, prepareGcpProject } from "./bootstrap";
|
|
@@ -259,7 +259,7 @@ async function runDoctor() {
|
|
|
259
259
|
return "gcx available";
|
|
260
260
|
});
|
|
261
261
|
await record(results, "dashboard artifacts", "warn", async () => {
|
|
262
|
-
if (!(await
|
|
262
|
+
if (!(await directoryExists("./grafana")) && !(await directoryExists("./dashboards"))) {
|
|
263
263
|
throw new Error("no grafana/ or dashboards/ directory found");
|
|
264
264
|
}
|
|
265
265
|
return "dashboard directory found";
|
|
@@ -441,6 +441,14 @@ async function findFiles(root: string, suffix = ""): Promise<string[]> {
|
|
|
441
441
|
return files;
|
|
442
442
|
}
|
|
443
443
|
|
|
444
|
+
async function directoryExists(path: string) {
|
|
445
|
+
try {
|
|
446
|
+
return (await stat(path)).isDirectory();
|
|
447
|
+
} catch {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
444
452
|
if (import.meta.main) {
|
|
445
453
|
await main();
|
|
446
454
|
}
|