@norskvideo/ctl-dev-kit 0.1.54 → 0.1.55
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.
|
@@ -264,7 +264,11 @@ export function demoProblems(repoRoot: string, canonicalShim: string): string[]
|
|
|
264
264
|
const problems: string[] = [];
|
|
265
265
|
const hasSpec = existsSync(join(repoRoot, DEMO_SPEC));
|
|
266
266
|
const shimPath = join(repoRoot, DEMO_SHIM);
|
|
267
|
-
if (existsSync(shimPath)) {
|
|
267
|
+
if (existsSync(shimPath) && statSync(shimPath).isDirectory()) {
|
|
268
|
+
problems.push(
|
|
269
|
+
`${DEMO_SHIM} is a directory; the convention puts the executable shim at that path — move the directory (scripts/demo-tools, say) and re-run sync-drift to write the shim.`,
|
|
270
|
+
);
|
|
271
|
+
} else if (existsSync(shimPath)) {
|
|
268
272
|
const actual = readFileSync(shimPath, "utf8");
|
|
269
273
|
if (actual !== canonicalShim) {
|
|
270
274
|
problems.push(
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
// cannot mechanically converge (e.g. a workflow with no product key to preserve)
|
|
19
19
|
// is left for check-drift to flag, and a convention that genuinely breaks the
|
|
20
20
|
// product surfaces as a red lint/typecheck/test — not as a silent bad copy.
|
|
21
|
-
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
21
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
22
22
|
import { dirname, join } from "node:path";
|
|
23
23
|
import {
|
|
24
24
|
BEGIN,
|
|
@@ -203,6 +203,12 @@ function syncDemoShim(repoRoot: string, canonical: string, r: SyncReport): void
|
|
|
203
203
|
const rel = "scripts/demo";
|
|
204
204
|
const path = join(repoRoot, rel);
|
|
205
205
|
if (!existsSync(join(repoRoot, "tests/demo.spec.ts")) && !existsSync(path)) return;
|
|
206
|
+
// A product's own tooling may already live at scripts/demo/ (playout did):
|
|
207
|
+
// never write over it; the gate names it and says where the shim goes.
|
|
208
|
+
if (existsSync(path) && statSync(path).isDirectory()) {
|
|
209
|
+
r.skipped.push(`${rel} (a directory; move it, the shim goes here)`);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
206
212
|
mkdirSync(dirname(path), { recursive: true });
|
|
207
213
|
writeIfChanged(path, canonical, rel, r.written);
|
|
208
214
|
chmodSync(path, 0o755);
|