git-span 1.0.148 → 1.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/bin/git-span.exe +8 -2
- package/man/git-span.1 +2 -2
- package/package.json +6 -6
- package/scripts/postinstall.js +22 -0
package/bin/git-span.exe
CHANGED
|
@@ -2,5 +2,11 @@ git-span placeholder. scripts/postinstall.js replaces this file
|
|
|
2
2
|
with the native binary for your platform. The name ends in .exe and the
|
|
3
3
|
first line intentionally has NO "#!" shebang so npm/yarn/pnpm cmd-shim
|
|
4
4
|
generates a direct-exec wrapper that runs on Windows; Unix ignores the
|
|
5
|
-
.exe suffix and execs by mode bit.
|
|
6
|
-
|
|
5
|
+
.exe suffix and execs by mode bit. This file is tracked NON-executable
|
|
6
|
+
(mode 644) on purpose: without a shebang, execvp()'s ENOEXEC fallback
|
|
7
|
+
would otherwise re-exec it via /bin/sh, which parses this very sentence
|
|
8
|
+
as a command line and recurses into itself indefinitely (a fork bomb —
|
|
9
|
+
see the git-span-fork-bomb incident report). Non-executable makes execvp
|
|
10
|
+
fail fast with EACCES instead. postinstall.js re-chmods to 0755 only
|
|
11
|
+
after replacing this text with the real binary. If you are seeing this
|
|
12
|
+
text, the postinstall step did not run.
|
package/man/git-span.1
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.ie \n(.g .ds Aq \(aq
|
|
2
2
|
.el .ds Aq '
|
|
3
|
-
.TH git-span 1 "git-span 1.
|
|
3
|
+
.TH git-span 1 "git-span 1.1.1"
|
|
4
4
|
.ie \n(.g .ds Aq \(aq
|
|
5
5
|
.el .ds Aq '
|
|
6
6
|
.SH NAME
|
|
@@ -136,7 +136,7 @@ Print this message or the help of the given subcommand(s)
|
|
|
136
136
|
.ie \n(.g .ds Aq \(aq
|
|
137
137
|
.el .ds Aq '
|
|
138
138
|
.SH VERSION
|
|
139
|
-
v1.
|
|
139
|
+
v1.1.1
|
|
140
140
|
.SH EXAMPLES
|
|
141
141
|
Anchor a new span alongside a code change:
|
|
142
142
|
.PP
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-span",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"bin": "bin/git-span.exe",
|
|
5
5
|
"man": [
|
|
6
6
|
"man/git-span.1"
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"scripts/postinstall.js"
|
|
25
25
|
],
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"git-span-darwin-arm64": "1.
|
|
28
|
-
"git-span-darwin-x64": "1.
|
|
29
|
-
"git-span-linux-arm64": "1.
|
|
30
|
-
"git-span-linux-x64": "1.
|
|
31
|
-
"git-span-win32-x64": "1.
|
|
27
|
+
"git-span-darwin-arm64": "1.1.1",
|
|
28
|
+
"git-span-darwin-x64": "1.1.1",
|
|
29
|
+
"git-span-linux-arm64": "1.1.1",
|
|
30
|
+
"git-span-linux-x64": "1.1.1",
|
|
31
|
+
"git-span-win32-x64": "1.1.1"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
package/scripts/postinstall.js
CHANGED
|
@@ -71,9 +71,31 @@ function isInsideSourceTree() {
|
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
function hasUsableBinaryInSourceTree() {
|
|
75
|
+
const platform = PLATFORM_MAP[process.platform];
|
|
76
|
+
const arch = ARCH_MAP[process.arch];
|
|
77
|
+
if (!platform || !arch) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
const sourceBinaryName = process.platform === 'win32' ? 'git-span.exe' : 'git-span';
|
|
81
|
+
try {
|
|
82
|
+
const packageDir = path.dirname(require.resolve(`git-span-${platform}-${arch}/package.json`));
|
|
83
|
+
return fs.existsSync(path.join(packageDir, 'bin', sourceBinaryName));
|
|
84
|
+
} catch {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
74
89
|
function main() {
|
|
75
90
|
if (isInsideSourceTree()) {
|
|
76
91
|
console.log('git-span: postinstall skipped (running inside source tree).');
|
|
92
|
+
if (!hasUsableBinaryInSourceTree()) {
|
|
93
|
+
console.warn(
|
|
94
|
+
'git-span: warning: bin/git-span.exe is still the tracked placeholder and no ' +
|
|
95
|
+
'prebuilt platform binary was found either. `git span` will fail (not run) until ' +
|
|
96
|
+
'you run `yarn build:local` from packages/git-span.'
|
|
97
|
+
);
|
|
98
|
+
}
|
|
77
99
|
return;
|
|
78
100
|
}
|
|
79
101
|
|