@structor-dev/cli 0.2.0 → 0.2.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/bin/structor.mjs
CHANGED
|
@@ -1092,7 +1092,15 @@ async function main() {
|
|
|
1092
1092
|
throw new Error(`Unknown command: ${command}`);
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
|
-
|
|
1095
|
+
async function isDirectCliInvocation() {
|
|
1096
|
+
if (!process.argv[1]) return false;
|
|
1097
|
+
|
|
1098
|
+
const invokedPath = await realpath(process.argv[1]).catch(() => path.resolve(process.argv[1]));
|
|
1099
|
+
const modulePath = await realpath(fileURLToPath(import.meta.url)).catch(() => fileURLToPath(import.meta.url));
|
|
1100
|
+
return pathToFileURL(invokedPath).href === pathToFileURL(modulePath).href;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
if (await isDirectCliInvocation()) {
|
|
1096
1104
|
main().catch((error) => {
|
|
1097
1105
|
fail(error instanceof Error ? error.message : String(error));
|
|
1098
1106
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -7,6 +7,8 @@ import { collectFiles, failIfErrors, repoRoot } from "./lib.mjs";
|
|
|
7
7
|
const errors = [];
|
|
8
8
|
const activeFiles = await collectFiles(".", (file) => {
|
|
9
9
|
if (file.startsWith(".git/")) return false;
|
|
10
|
+
if (file.startsWith(".claude/worktrees/")) return false;
|
|
11
|
+
if (file.startsWith(".codex/worktrees/")) return false;
|
|
10
12
|
if (file.startsWith("template/")) return false;
|
|
11
13
|
return [".md", ".json", ".mjs"].some((suffix) => file.endsWith(suffix));
|
|
12
14
|
});
|