@spunto/build 0.6.0 → 0.6.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/package.json +1 -1
- package/src/script/setup-script.ts +12 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spunto/build",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Spunto's shared Build engine — the devcontainer image protocol and VS Code extension registry clients, with no database, no HTTP framework and no UI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -295,9 +295,16 @@ function credentialsBlock(params: {
|
|
|
295
295
|
const { homeDir, username, userInfo, userSshPrivateKey, projectDeployKey } = params
|
|
296
296
|
const lines: string[] = []
|
|
297
297
|
|
|
298
|
+
// Through `asUser`, not plain `git config --global`. The setup script is the container's CMD,
|
|
299
|
+
// so it runs as root, and `--global` follows $HOME — every one of these settings landed in
|
|
300
|
+
// /root/.gitconfig while git, in the user's terminal, reads ${homeDir}/.gitconfig. The identity
|
|
301
|
+
// was silently absent, and so was the credential helper below: git fell back to prompting for a
|
|
302
|
+
// password on a repository it had just cloned.
|
|
298
303
|
if (userInfo) {
|
|
299
|
-
lines.push(`git config --global user.name ${JSON.stringify(userInfo.name)}`)
|
|
300
|
-
if (userInfo.email)
|
|
304
|
+
lines.push(asUser(username, `git config --global user.name ${JSON.stringify(userInfo.name)}`))
|
|
305
|
+
if (userInfo.email) {
|
|
306
|
+
lines.push(asUser(username, `git config --global user.email ${JSON.stringify(userInfo.email)}`))
|
|
307
|
+
}
|
|
301
308
|
}
|
|
302
309
|
|
|
303
310
|
if (userSshPrivateKey) {
|
|
@@ -330,8 +337,9 @@ function credentialsBlock(params: {
|
|
|
330
337
|
GIT_CREDENTIAL_HELPER,
|
|
331
338
|
"SPUNTO_HELPER",
|
|
332
339
|
` chmod +x ${homeDir}/.spunto/git-credential-spunto`,
|
|
333
|
-
`
|
|
334
|
-
|
|
340
|
+
` chown ${username} ${homeDir}/.spunto/git-credential-spunto`,
|
|
341
|
+
` ${asUser(username, `git config --global credential.helper ${homeDir}/.spunto/git-credential-spunto`)}`,
|
|
342
|
+
` ${asUser(username, "git config --global credential.useHttpPath true")}`,
|
|
335
343
|
' echo "Git credential helper configured"',
|
|
336
344
|
"fi",
|
|
337
345
|
)
|