@kaynooo/cli-git 0.18.1 → 0.18.2
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/README.md +1 -1
- package/dist/gb.js +4 -1
- package/dist/gc.js +4 -1
- package/dist/gcl.js +64 -23
- package/dist/gd.js +4 -1
- package/dist/gf.js +6 -3
- package/dist/gm.js +4 -1
- package/dist/gp.js +6 -3
- package/dist/gst.js +4 -1
- package/dist/gu.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ Prints one line with the branch, its upstream and how far ahead and behind it is
|
|
|
64
64
|
|
|
65
65
|
## gcl
|
|
66
66
|
|
|
67
|
-
`gcl <repo> [dir]` clones into `<workspace>/<name>` (the workspace `cli config` reports) or into `dir`, and prints the path on stdout, so `cd (gcl kaynooo/cli)` lands in it. `<repo>` is a URL, an scp-style address, a local path or `owner/name`, read as `https://git.kaynooo.fr/owner/name.git`; the `forge` key of `~/.config/kaynooo-cli/config.json` names another host.
|
|
67
|
+
`gcl <repo> [dir]` clones into `<workspace>/<name>` (the workspace `cli config` reports) or into `dir`, and prints the path on stdout, so `cd (gcl kaynooo/cli)` lands in it. `<repo>` is a URL, an scp-style address, a local path or `owner/name`, read as `https://git.kaynooo.fr/owner/name.git`; the `forge` key of `~/.config/kaynooo-cli/config.json` names another host (`http://host:port` for another scheme). A private repository refuses that anonymous https clone: with the `forgeSsh` key set to the forge's ssh address (`git@git.example.org`, `ssh://git@git.example.org:22022`) gcl clones it over ssh instead, else the error names the ssh address to give. Off a terminal, gcl, gf and gp keep git and ssh from asking for a password, on the terminal or through the desktop's askpass window: they fail at once instead.
|
|
68
68
|
|
|
69
69
|
- A folder that already holds the repository is not cloned again: it is fetched and fast-forwarded as `gf` does. A folder holding anything else is refused, exit 1.
|
|
70
70
|
- `--json` prints `{url, path, branch, head, outcome}`, `outcome` being `cloned` or `existing`.
|
package/dist/gb.js
CHANGED
|
@@ -1982,12 +1982,15 @@ import { join as join6 } from "path";
|
|
|
1982
1982
|
import process16 from "process";
|
|
1983
1983
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1984
1984
|
var ECHOED = /username|yes\/no/i;
|
|
1985
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1985
1986
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1986
1987
|
function askpass(pause = () => () => {
|
|
1987
1988
|
return;
|
|
1988
1989
|
}) {
|
|
1989
1990
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1990
|
-
return
|
|
1991
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1992
|
+
return;
|
|
1993
|
+
} };
|
|
1991
1994
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1992
1995
|
const socketPath = join6(dir, "socket");
|
|
1993
1996
|
const script = join6(dir, "askpass");
|
package/dist/gc.js
CHANGED
|
@@ -1984,12 +1984,15 @@ import { join as join6 } from "path";
|
|
|
1984
1984
|
import process16 from "process";
|
|
1985
1985
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1986
1986
|
var ECHOED = /username|yes\/no/i;
|
|
1987
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1987
1988
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1988
1989
|
function askpass(pause = () => () => {
|
|
1989
1990
|
return;
|
|
1990
1991
|
}) {
|
|
1991
1992
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1992
|
-
return
|
|
1993
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1994
|
+
return;
|
|
1995
|
+
} };
|
|
1993
1996
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1994
1997
|
const socketPath = join6(dir, "socket");
|
|
1995
1998
|
const script = join6(dir, "askpass");
|
package/dist/gcl.js
CHANGED
|
@@ -1985,12 +1985,15 @@ import { join as join6 } from "path";
|
|
|
1985
1985
|
import process16 from "process";
|
|
1986
1986
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1987
1987
|
var ECHOED = /username|yes\/no/i;
|
|
1988
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1988
1989
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1989
1990
|
function askpass(pause = () => () => {
|
|
1990
1991
|
return;
|
|
1991
1992
|
}) {
|
|
1992
1993
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1993
|
-
return
|
|
1994
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1995
|
+
return;
|
|
1996
|
+
} };
|
|
1994
1997
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1995
1998
|
const socketPath = join6(dir, "socket");
|
|
1996
1999
|
const script = join6(dir, "askpass");
|
|
@@ -2702,6 +2705,7 @@ var DEFAULT_FORGE = "git.kaynooo.fr";
|
|
|
2702
2705
|
var USAGE = `gcl <repo> [dir]: clones a repository into the workspace folder and prints where it landed
|
|
2703
2706
|
|
|
2704
2707
|
<repo> is a URL, an scp-style address, a local path or \`owner/name\`, read as \`https://${DEFAULT_FORGE}/owner/name.git\` (the \`forge\` config key names another host). Without <dir> the clone goes to <workspace>/<name>, the workspace \`cli config\` reports.
|
|
2708
|
+
A private repository refuses an \`owner/name\` clone over https: with the \`forgeSsh\` config key set to the forge's ssh address (\`git@host\` or \`ssh://git@host:port\`) it is cloned over ssh instead, else the error names the ssh address to give. Off a terminal git never asks for a password, through the terminal or a desktop window: it fails instead.
|
|
2705
2709
|
A folder that already holds the repository is fetched and fast-forwarded as gf does, not cloned again; one holding anything else is refused.`;
|
|
2706
2710
|
var EXITS = [[0, "it cloned the repository, or found it and brought it up to date"], [1, "git could not clone it, or the folder is taken"], [2, "a usage error"]];
|
|
2707
2711
|
var OPTIONS = {
|
|
@@ -2713,62 +2717,99 @@ var OWNER_NAME = /^[\w.-]+\/[\w.-]+$/;
|
|
|
2713
2717
|
var GIT_SUFFIX = /\.git\/?$/;
|
|
2714
2718
|
var TRAILING_SLASH = /\/+$/;
|
|
2715
2719
|
var LAST_SEGMENT = /[/:]/;
|
|
2720
|
+
var AUTH_REFUSED = /could not read Username|Authentication failed|terminal prompts disabled|\b40[13]\b/i;
|
|
2721
|
+
var SSH_BASE_END = /[/:]$/;
|
|
2716
2722
|
function urlOf(repo, forge) {
|
|
2717
2723
|
if (repo.startsWith("~/"))
|
|
2718
2724
|
return join11(homedir6(), repo.slice(2));
|
|
2719
2725
|
if (SCHEME.test(repo) || SCP.test(repo) || repo.startsWith("/") || repo.startsWith("."))
|
|
2720
2726
|
return repo;
|
|
2721
2727
|
if (OWNER_NAME.test(repo))
|
|
2722
|
-
return `https://${forge}/${repo.replace(GIT_SUFFIX, "")}.git`;
|
|
2728
|
+
return `${SCHEME.test(forge) ? forge.replace(TRAILING_SLASH, "") : `https://${forge}`}/${repo.replace(GIT_SUFFIX, "")}.git`;
|
|
2723
2729
|
return fail(`${repo} is no URL and no owner/name`, 2);
|
|
2724
2730
|
}
|
|
2731
|
+
function sshUrlOf(repo, base) {
|
|
2732
|
+
const separator = SCHEME.test(base) ? "/" : ":";
|
|
2733
|
+
return `${base}${SSH_BASE_END.test(base) ? "" : separator}${repo.replace(GIT_SUFFIX, "")}.git`;
|
|
2734
|
+
}
|
|
2735
|
+
function setting(config, key) {
|
|
2736
|
+
const value = config[key];
|
|
2737
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
2738
|
+
}
|
|
2725
2739
|
function nameOf(url) {
|
|
2726
2740
|
return basename(url.replace(TRAILING_SLASH, "").split(LAST_SEGMENT).at(-1) ?? "").replace(GIT_SUFFIX, "");
|
|
2727
2741
|
}
|
|
2728
2742
|
function same(url) {
|
|
2729
2743
|
return url.replace(TRAILING_SLASH, "").replace(GIT_SUFFIX, "").toLowerCase();
|
|
2730
2744
|
}
|
|
2745
|
+
async function update({ url, sshUrl, path }, env) {
|
|
2746
|
+
if (!statSync2(path).isDirectory() || await toplevelOf(path) !== realpathSync3(path))
|
|
2747
|
+
fail(`${path} exists and is not a repository, nothing cloned`, 1);
|
|
2748
|
+
const origin = (await git2(["-C", path, "remote", "get-url", "origin"])).stdout.trim();
|
|
2749
|
+
if (same(origin) !== same(url) && (sshUrl === undefined || same(origin) !== same(sshUrl)))
|
|
2750
|
+
fail(`${path} is a clone of ${origin === "" ? "nothing (no origin)" : origin}, not ${url}, nothing cloned`, 1);
|
|
2751
|
+
const synced = await sync(await repoState(path), { pull: true, env });
|
|
2752
|
+
if (synced.outcome === "refused")
|
|
2753
|
+
fail(`${path} is already cloned but could not be brought up to date: ${synced.reason}`, 1);
|
|
2754
|
+
return origin;
|
|
2755
|
+
}
|
|
2756
|
+
async function clone({ repo, url, sshUrl, forgeSsh, path }, env) {
|
|
2757
|
+
const cloned = await git2(["clone", url, path], env);
|
|
2758
|
+
if (cloned.code === 0)
|
|
2759
|
+
return url;
|
|
2760
|
+
if (sshUrl === undefined || !AUTH_REFUSED.test(cloned.stderr))
|
|
2761
|
+
fail(`git clone failed:
|
|
2762
|
+
${cloned.stderr.trim()}`, 1);
|
|
2763
|
+
if (forgeSsh === undefined)
|
|
2764
|
+
fail(`git clone failed:
|
|
2765
|
+
${cloned.stderr.trim()}
|
|
2766
|
+
${repo} may be private, which https refuses without a login: clone it over ssh, as gcl ${sshUrl}, or set forgeSsh in ~/.config/kaynooo-cli/config.json to the forge's ssh address so that owner/name does`, 1);
|
|
2767
|
+
console.error(`${url} wants a login, ${repo} may be private: cloning over ssh from ${sshUrl}`);
|
|
2768
|
+
const overSsh = await git2(["clone", sshUrl, path], env);
|
|
2769
|
+
if (overSsh.code !== 0)
|
|
2770
|
+
fail(`git clone failed over https and over ssh:
|
|
2771
|
+
${overSsh.stderr.trim()}`, 1);
|
|
2772
|
+
return sshUrl;
|
|
2773
|
+
}
|
|
2731
2774
|
async function main(argv) {
|
|
2732
2775
|
const { values, positionals } = parse(argv, USAGE, OPTIONS, { positionals: ["<repo>", "[dir]"], exits: EXITS, replaces: "git clone with the url and the folder typed out, then a cd", examples: ["gcl kaynooo/cli", ["gcl git@github.com:oven-sh/bun.git", "an scp address"], ["gcl kaynooo/cli ~/tmp/cli", "a folder of your own"]] });
|
|
2733
2776
|
const [repo, given] = positionals;
|
|
2734
2777
|
if (repo === undefined)
|
|
2735
2778
|
fail("gcl needs the repository to clone: gcl owner/name", 2);
|
|
2736
|
-
const
|
|
2737
|
-
const
|
|
2779
|
+
const config = readUserConfig("config");
|
|
2780
|
+
const forge = setting(config, "forge") ?? DEFAULT_FORGE;
|
|
2781
|
+
const url = urlOf(repo, forge);
|
|
2782
|
+
const isOwnerName = OWNER_NAME.test(repo) && !repo.startsWith(".");
|
|
2783
|
+
const forgeSsh = setting(config, "forgeSsh");
|
|
2784
|
+
const sshUrl = isOwnerName ? sshUrlOf(repo, forgeSsh ?? `git@${SCHEME.test(forge) ? new URL(forge).hostname : forge}`) : undefined;
|
|
2738
2785
|
const name = nameOf(url);
|
|
2739
2786
|
if (name === "")
|
|
2740
2787
|
fail(`no folder name can be taken from ${url}, give one: gcl ${repo} <dir>`, 2);
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
fail(`${path} is already cloned but could not be brought up to date: ${synced.reason}`, 1);
|
|
2752
|
-
outcome = "existing";
|
|
2753
|
-
} else {
|
|
2754
|
-
const cloned = await git2(["clone", url, path]);
|
|
2755
|
-
if (cloned.code !== 0)
|
|
2756
|
-
fail(`git clone failed:
|
|
2757
|
-
${cloned.stderr.trim()}`, 1);
|
|
2788
|
+
const target = { repo, url, sshUrl, forgeSsh, path: given === undefined ? join11(workspaceRoot(), name) : resolve6(given) };
|
|
2789
|
+
const { path } = target;
|
|
2790
|
+
const outcome = existsSync4(path) && (!statSync2(path).isDirectory() || readdirSync(path).length > 0) ? "existing" : "cloned";
|
|
2791
|
+
const prompts = askpass();
|
|
2792
|
+
const env = { ...process24.env, ...prompts.env };
|
|
2793
|
+
let from;
|
|
2794
|
+
try {
|
|
2795
|
+
from = outcome === "existing" ? await update(target, env) : await clone(target, env);
|
|
2796
|
+
} finally {
|
|
2797
|
+
prompts.close();
|
|
2758
2798
|
}
|
|
2759
2799
|
const { status, head } = await repoState(path);
|
|
2760
|
-
const result = { url, path, branch: status?.branch ?? null, head: head?.sha ?? null, outcome };
|
|
2800
|
+
const result = { url: from, path, branch: status?.branch ?? null, head: head?.sha ?? null, outcome };
|
|
2761
2801
|
if (values.json === true)
|
|
2762
2802
|
printJson(result);
|
|
2763
2803
|
else
|
|
2764
2804
|
console.log(path);
|
|
2765
2805
|
if (values.json !== true)
|
|
2766
|
-
console.error(`${outcome === "cloned" ? "cloned" : "already cloned"} ${
|
|
2806
|
+
console.error(`${outcome === "cloned" ? "cloned" : "already cloned"} ${from}${result.branch === null ? "" : ` on ${result.branch}`}${result.head === null ? "" : ` at ${result.head}`}`);
|
|
2767
2807
|
return 0;
|
|
2768
2808
|
}
|
|
2769
2809
|
if (import.meta.main)
|
|
2770
2810
|
process24.exitCode = await runMain({ name: "gcl", run: main });
|
|
2771
2811
|
export {
|
|
2772
2812
|
nameOf,
|
|
2813
|
+
sshUrlOf,
|
|
2773
2814
|
urlOf
|
|
2774
2815
|
};
|
package/dist/gd.js
CHANGED
|
@@ -1982,12 +1982,15 @@ import { join as join6 } from "path";
|
|
|
1982
1982
|
import process16 from "process";
|
|
1983
1983
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1984
1984
|
var ECHOED = /username|yes\/no/i;
|
|
1985
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1985
1986
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1986
1987
|
function askpass(pause = () => () => {
|
|
1987
1988
|
return;
|
|
1988
1989
|
}) {
|
|
1989
1990
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1990
|
-
return
|
|
1991
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1992
|
+
return;
|
|
1993
|
+
} };
|
|
1991
1994
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1992
1995
|
const socketPath = join6(dir, "socket");
|
|
1993
1996
|
const script = join6(dir, "askpass");
|
package/dist/gf.js
CHANGED
|
@@ -1982,12 +1982,15 @@ import { join as join6 } from "path";
|
|
|
1982
1982
|
import process16 from "process";
|
|
1983
1983
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1984
1984
|
var ECHOED = /username|yes\/no/i;
|
|
1985
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1985
1986
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1986
1987
|
function askpass(pause = () => () => {
|
|
1987
1988
|
return;
|
|
1988
1989
|
}) {
|
|
1989
1990
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1990
|
-
return
|
|
1991
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1992
|
+
return;
|
|
1993
|
+
} };
|
|
1991
1994
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1992
1995
|
const socketPath = join6(dir, "socket");
|
|
1993
1996
|
const script = join6(dir, "askpass");
|
|
@@ -2723,14 +2726,14 @@ async function main(argv) {
|
|
|
2723
2726
|
const results = [];
|
|
2724
2727
|
const progress = progressLine();
|
|
2725
2728
|
const prompts = askpass(progress.pause);
|
|
2726
|
-
const env =
|
|
2729
|
+
const env = { ...process24.env, ...prompts.env };
|
|
2727
2730
|
try {
|
|
2728
2731
|
for (const [at, repo] of repos.entries()) {
|
|
2729
2732
|
progress.update(repos.length > 1 ? { step: `fetching ${repo.path}`, done: at, total: repos.length, unit: "repositories" } : { step: `fetching ${repo.path}` });
|
|
2730
2733
|
results.push(await sync(repo, { pull: values["no-pull"] !== true, env }));
|
|
2731
2734
|
}
|
|
2732
2735
|
} finally {
|
|
2733
|
-
prompts
|
|
2736
|
+
prompts.close();
|
|
2734
2737
|
progress.stop();
|
|
2735
2738
|
}
|
|
2736
2739
|
if (values.json === true)
|
package/dist/gm.js
CHANGED
|
@@ -1984,12 +1984,15 @@ import { join as join6 } from "path";
|
|
|
1984
1984
|
import process16 from "process";
|
|
1985
1985
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1986
1986
|
var ECHOED = /username|yes\/no/i;
|
|
1987
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1987
1988
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1988
1989
|
function askpass(pause = () => () => {
|
|
1989
1990
|
return;
|
|
1990
1991
|
}) {
|
|
1991
1992
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1992
|
-
return
|
|
1993
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1994
|
+
return;
|
|
1995
|
+
} };
|
|
1993
1996
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1994
1997
|
const socketPath = join6(dir, "socket");
|
|
1995
1998
|
const script = join6(dir, "askpass");
|
package/dist/gp.js
CHANGED
|
@@ -1982,12 +1982,15 @@ import { join as join6 } from "path";
|
|
|
1982
1982
|
import process16 from "process";
|
|
1983
1983
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1984
1984
|
var ECHOED = /username|yes\/no/i;
|
|
1985
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1985
1986
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1986
1987
|
function askpass(pause = () => () => {
|
|
1987
1988
|
return;
|
|
1988
1989
|
}) {
|
|
1989
1990
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1990
|
-
return
|
|
1991
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1992
|
+
return;
|
|
1993
|
+
} };
|
|
1991
1994
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1992
1995
|
const socketPath = join6(dir, "socket");
|
|
1993
1996
|
const script = join6(dir, "askpass");
|
|
@@ -2741,14 +2744,14 @@ async function main(argv) {
|
|
|
2741
2744
|
const results = [];
|
|
2742
2745
|
const progress = progressLine();
|
|
2743
2746
|
const prompts = askpass(progress.pause);
|
|
2744
|
-
const env =
|
|
2747
|
+
const env = { ...process24.env, ...prompts.env };
|
|
2745
2748
|
try {
|
|
2746
2749
|
for (const [at, { repo, branch }] of pushes.entries()) {
|
|
2747
2750
|
progress.update(pushes.length > 1 ? { step: `pushing ${repo.path}`, done: at, total: pushes.length, unit: "pushes" } : { step: `pushing ${repo.path}` });
|
|
2748
2751
|
results.push(await push(repo, branch, { dryRun: values["dry-run"] === true, extra: rest, env }));
|
|
2749
2752
|
}
|
|
2750
2753
|
} finally {
|
|
2751
|
-
prompts
|
|
2754
|
+
prompts.close();
|
|
2752
2755
|
progress.stop();
|
|
2753
2756
|
}
|
|
2754
2757
|
if (values.json === true)
|
package/dist/gst.js
CHANGED
|
@@ -1982,12 +1982,15 @@ import { join as join6 } from "path";
|
|
|
1982
1982
|
import process16 from "process";
|
|
1983
1983
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1984
1984
|
var ECHOED = /username|yes\/no/i;
|
|
1985
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1985
1986
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1986
1987
|
function askpass(pause = () => () => {
|
|
1987
1988
|
return;
|
|
1988
1989
|
}) {
|
|
1989
1990
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1990
|
-
return
|
|
1991
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1992
|
+
return;
|
|
1993
|
+
} };
|
|
1991
1994
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1992
1995
|
const socketPath = join6(dir, "socket");
|
|
1993
1996
|
const script = join6(dir, "askpass");
|
package/dist/gu.js
CHANGED
|
@@ -1984,12 +1984,15 @@ import { join as join6 } from "path";
|
|
|
1984
1984
|
import process16 from "process";
|
|
1985
1985
|
var SOCKET_VARIABLE = "KAYNOOO_ASKPASS_SOCKET";
|
|
1986
1986
|
var ECHOED = /username|yes\/no/i;
|
|
1987
|
+
var NO_PROMPTS = { GIT_TERMINAL_PROMPT: "0", GIT_ASKPASS: "", SSH_ASKPASS: "", SSH_ASKPASS_REQUIRE: "never" };
|
|
1987
1988
|
var quoted = (text) => `'${text.replaceAll("'", `'\\''`)}'`;
|
|
1988
1989
|
function askpass(pause = () => () => {
|
|
1989
1990
|
return;
|
|
1990
1991
|
}) {
|
|
1991
1992
|
if (process16.stdin.isTTY !== true || process16.stderr.isTTY !== true || process16.argv[1] === undefined)
|
|
1992
|
-
return
|
|
1993
|
+
return { env: { ...NO_PROMPTS }, close: () => {
|
|
1994
|
+
return;
|
|
1995
|
+
} };
|
|
1993
1996
|
const dir = mkdtempSync(join6(tmpdir(), "kaynooo-askpass-"));
|
|
1994
1997
|
const socketPath = join6(dir, "socket");
|
|
1995
1998
|
const script = join6(dir, "askpass");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-git",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.18.
|
|
4
|
+
"version": "0.18.2",
|
|
5
5
|
"description": "gst, gc, gb, gp, gf, gm, gcl, gd and gu: a repository's state in one call, a commit of exactly the paths given, its message checked before anything is staged, a branch picked, nested repositories pushed or fetched, a branch merged with its conflicts listed, a clone into the workspace, the changes per file and an undo that keeps what it takes away.",
|
|
6
6
|
"author": "Kaynooo <contact@kaynooo.fr>",
|
|
7
7
|
"license": "MIT",
|