pinokiod 8.0.6 → 8.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/server/index.js +0 -4
- package/test/github-connection.test.js +17 -12
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1546,15 +1546,11 @@ class Server {
|
|
|
1546
1546
|
github_login_params() {
|
|
1547
1547
|
const doneMarker = "PINOKIO_GITHUB_LOGIN_DONE"
|
|
1548
1548
|
const delimiter = this.kernel.platform === "win32" ? " && " : " ; "
|
|
1549
|
-
const verifyCommand = this.kernel.platform === "win32"
|
|
1550
|
-
? "powershell.exe -NoProfile -Command \"$env:GIT_TERMINAL_PROMPT='0'; $env:GCM_INTERACTIVE='never'; @('protocol=https','host=github.com','') | git credential fill > $null; exit $LASTEXITCODE\""
|
|
1551
|
-
: "printf 'protocol=https\\nhost=github.com\\n\\n' | GIT_TERMINAL_PROMPT=0 GCM_INTERACTIVE=never git credential fill >/dev/null"
|
|
1552
1549
|
const doneCommand = this.kernel.platform === "win32"
|
|
1553
1550
|
? "echo P^INOKIO_GITHUB_LOGIN_DONE"
|
|
1554
1551
|
: "(GCM_DONE=INOKIO_GITHUB_LOGIN_DONE; printf 'P%s\\n' \"$GCM_DONE\")"
|
|
1555
1552
|
const loginCommand = [
|
|
1556
1553
|
"git credential-manager github login --device --force",
|
|
1557
|
-
verifyCommand,
|
|
1558
1554
|
doneCommand
|
|
1559
1555
|
].join(" && ")
|
|
1560
1556
|
|
|
@@ -73,24 +73,29 @@ test('GitHub connection coalesces only concurrent GCM checks', async () => {
|
|
|
73
73
|
assert.equal(calls, 2)
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
-
test('GitHub login
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
test('GitHub login completes directly from GCM success on macOS and Linux', () => {
|
|
77
|
+
for (const platform of ['darwin', 'linux']) {
|
|
78
|
+
const { doneMarker, message } = Server.prototype.github_login_params.call({
|
|
79
|
+
kernel: { platform }
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
assert.equal(doneMarker, 'PINOKIO_GITHUB_LOGIN_DONE')
|
|
83
|
+
assert.match(message, /git credential-manager github login --device --force && \(GCM_DONE=INOKIO_GITHUB_LOGIN_DONE; printf 'P%s\\n' "\$GCM_DONE"\)/)
|
|
84
|
+
assert.doesNotMatch(message, /credential fill/)
|
|
85
|
+
assert.doesNotMatch(message, /git credential-manager github login --device --force\s*;/)
|
|
86
|
+
assert.doesNotMatch(message, /--web/)
|
|
87
|
+
assert.doesNotMatch(message, /PINOKIO_GITHUB_LOGIN_DONE/)
|
|
88
|
+
}
|
|
86
89
|
})
|
|
87
90
|
|
|
88
|
-
test('GitHub login
|
|
91
|
+
test('GitHub login completes directly from GCM success on Windows', () => {
|
|
89
92
|
const { message } = Server.prototype.github_login_params.call({
|
|
90
93
|
kernel: { platform: 'win32' }
|
|
91
94
|
})
|
|
92
95
|
|
|
93
|
-
assert.match(message, /git credential-manager github login --device --force &&
|
|
96
|
+
assert.match(message, /git credential-manager github login --device --force && echo P\^INOKIO_GITHUB_LOGIN_DONE/)
|
|
97
|
+
assert.doesNotMatch(message, /credential fill/)
|
|
98
|
+
assert.doesNotMatch(message, /powershell\.exe/)
|
|
94
99
|
assert.doesNotMatch(message, /--web/)
|
|
95
100
|
assert.doesNotMatch(message, /PINOKIO_GITHUB_LOGIN_DONE/)
|
|
96
101
|
})
|