@10stars/config 17.0.6 → 17.0.7
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
|
@@ -37,8 +37,14 @@ interface LinkRemoteOptions {
|
|
|
37
37
|
type Sibling = { abs: string; ref: string | null }
|
|
38
38
|
|
|
39
39
|
// execFile (not a shell) so branch names / refs / SHAs can't inject shell syntax.
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
// quiet: ignore the child's stderr (used by tryGit, whose callers tolerate failure — otherwise
|
|
41
|
+
// git's "fatal: …" for an expected miss, e.g. `describe` on a tagless shallow clone, spams the log).
|
|
42
|
+
const git = (args: string[], cwd?: string, quiet = false): string =>
|
|
43
|
+
execFileSync(`git`, args, {
|
|
44
|
+
cwd,
|
|
45
|
+
encoding: `utf8`,
|
|
46
|
+
...(quiet && { stdio: [`ignore`, `pipe`, `ignore`] }),
|
|
47
|
+
}).trim()
|
|
42
48
|
|
|
43
49
|
const execFileAsync = promisify(execFile)
|
|
44
50
|
|
|
@@ -51,7 +57,7 @@ const gitAsync = (args: string[], cwd?: string): Promise<unknown> =>
|
|
|
51
57
|
|
|
52
58
|
const tryGit = (args: string[], cwd?: string): string | null => {
|
|
53
59
|
try {
|
|
54
|
-
return git(args, cwd)
|
|
60
|
+
return git(args, cwd, true) // quiet: failure is expected/tolerated, so don't leak git's stderr
|
|
55
61
|
} catch {
|
|
56
62
|
return null
|
|
57
63
|
}
|