@tokenoftrust/cli 2.0.6 → 2.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 +1 -1
- package/src/git-credential.mjs +21 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
package/src/git-credential.mjs
CHANGED
|
@@ -159,7 +159,15 @@ export function forgeShimPath(env = process.env) {
|
|
|
159
159
|
/** The shim's contents: pin the ABSOLUTE node + CLI entry active at write time, with a
|
|
160
160
|
* PATH-search fallback for node, and FAIL LOUD to stderr (never silently) when no node
|
|
161
161
|
* is found — so a broken helper says how to fix itself instead of yielding an opaque
|
|
162
|
-
* "Repository not found". Pure — unit-tested.
|
|
162
|
+
* "Repository not found". Pure — unit-tested.
|
|
163
|
+
*
|
|
164
|
+
* The pinned ENTRY gets the same fail-loud treatment as NODE, because the path pinned at
|
|
165
|
+
* write time can stop existing: running the CLI from a dev checkout or a git worktree pins
|
|
166
|
+
* the shim to THAT tree, and reaping it breaks forge git auth for every checkout on the
|
|
167
|
+
* machine — including ones created by the globally-installed `tot`. Unguarded, the failure
|
|
168
|
+
* surfaces three layers away as a raw node MODULE_NOT_FOUND followed by git's
|
|
169
|
+
* "could not read Username" / "Repository not found", which names neither the stale path
|
|
170
|
+
* nor the fix. */
|
|
163
171
|
export function renderForgeShim(nodePath, entryPath) {
|
|
164
172
|
return [
|
|
165
173
|
"#!/bin/sh",
|
|
@@ -171,7 +179,18 @@ export function renderForgeShim(nodePath, entryPath) {
|
|
|
171
179
|
' echo "tot: no node runtime for the git credential helper — reinstall: npm i -g @tokenoftrust/cli@latest" >&2',
|
|
172
180
|
" exit 1",
|
|
173
181
|
"fi",
|
|
174
|
-
`
|
|
182
|
+
`ENTRY=${shq(entryPath)}`,
|
|
183
|
+
'if [ ! -f "$ENTRY" ]; then',
|
|
184
|
+
' echo "tot: the git credential helper points at a CLI that no longer exists:" >&2',
|
|
185
|
+
' echo " $ENTRY" >&2',
|
|
186
|
+
' echo " This shim was pinned by whichever tot ran last — if that was a dev" >&2',
|
|
187
|
+
' echo " checkout or a git worktree that has since been removed, forge git auth" >&2',
|
|
188
|
+
' echo " is broken for EVERY checkout on this machine until it is re-pinned." >&2',
|
|
189
|
+
' echo " Fix: run any tot command that touches git (e.g. \\`tot clone <tenant>\\`)" >&2',
|
|
190
|
+
' echo " from an installed tot, or reinstall: npm i -g @tokenoftrust/cli@latest" >&2',
|
|
191
|
+
" exit 1",
|
|
192
|
+
"fi",
|
|
193
|
+
'exec "$NODE" "$ENTRY" git-credential "$@"',
|
|
175
194
|
"",
|
|
176
195
|
].join("\n");
|
|
177
196
|
}
|