@davidbyoung/software-factory 0.1.0 → 0.1.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/guard-commit.mjs +5 -1
- package/package.json +1 -1
package/dist/guard-commit.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { existsSync, realpathSync } from "node:fs";
|
|
|
8
8
|
import { homedir } from "node:os";
|
|
9
9
|
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
|
-
import { defaultDeps, loadSettings } from "./config.mjs";
|
|
11
|
+
import { defaultDeps, loadSettings, settingsPath } from "./config.mjs";
|
|
12
12
|
/** Heredoc bodies and quoted strings blanked, so a commit message, grep
|
|
13
13
|
* pattern, or file body that mentions "git push -f" or "main" is not read as
|
|
14
14
|
* part of a command. A quoted single word is unquoted instead: the shell
|
|
@@ -182,6 +182,10 @@ export async function checkCommit(input, err) {
|
|
|
182
182
|
err(lastLines(`${r.stdout ?? ""}${r.stderr ?? ""}`).join("\n"));
|
|
183
183
|
return `the factory in ${top} blocked it, as above.`;
|
|
184
184
|
}
|
|
185
|
+
// A repository with no settings is not one the factory governs, such as
|
|
186
|
+
// another repository a session works in: it has no gate to run.
|
|
187
|
+
if (!existsSync(settingsPath(top)))
|
|
188
|
+
return null;
|
|
185
189
|
let commands;
|
|
186
190
|
try {
|
|
187
191
|
commands = (await loadSettings(defaultDeps(top))).beforeCommit;
|
package/package.json
CHANGED