@rotorsoft/gent 1.22.0 → 1.24.0
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/dist/chunk-OIHSXI5X.js +43 -0
- package/dist/chunk-OIHSXI5X.js.map +1 -0
- package/dist/{chunk-75KVN7ZC.js → chunk-P5MZOU4B.js} +211 -308
- package/dist/chunk-P5MZOU4B.js.map +1 -0
- package/dist/chunk-YS7HWP4W.js +283 -0
- package/dist/chunk-YS7HWP4W.js.map +1 -0
- package/dist/github-remote-G6UKRDUB.js +9 -0
- package/dist/index.js +187 -259
- package/dist/index.js.map +1 -1
- package/dist/setup-labels-FZEN5TKM.js +9 -0
- package/dist/setup-labels-FZEN5TKM.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-75KVN7ZC.js.map +0 -1
- package/dist/setup-labels-STWAFV2E.js +0 -8
- /package/dist/{setup-labels-STWAFV2E.js.map → github-remote-G6UKRDUB.js.map} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
checkGhAuth,
|
|
4
|
+
getCurrentBranch,
|
|
5
|
+
logger
|
|
6
|
+
} from "./chunk-P5MZOU4B.js";
|
|
7
|
+
|
|
8
|
+
// src/commands/github-remote.ts
|
|
9
|
+
import { execa } from "execa";
|
|
10
|
+
async function githubRemoteCommand() {
|
|
11
|
+
const isAuthenticated = await checkGhAuth();
|
|
12
|
+
if (!isAuthenticated) {
|
|
13
|
+
logger.error("GitHub CLI is not authenticated. Run: gh auth login");
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
try {
|
|
18
|
+
const { stdout } = await execa("git", [
|
|
19
|
+
"config",
|
|
20
|
+
"--get",
|
|
21
|
+
"remote.origin.url"
|
|
22
|
+
]);
|
|
23
|
+
if (stdout.trim()) {
|
|
24
|
+
logger.error("Remote origin already exists: " + stdout.trim());
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
logger.info("Creating GitHub repository...");
|
|
30
|
+
await execa("gh", ["repo", "create", "--source=.", "--push", "--private"]);
|
|
31
|
+
const branch = await getCurrentBranch();
|
|
32
|
+
logger.success(`Repository created and ${branch} pushed to GitHub`);
|
|
33
|
+
return true;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
logger.error(`Failed to create remote: ${error}`);
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
githubRemoteCommand
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-OIHSXI5X.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/github-remote.ts"],"sourcesContent":["import { execa } from \"execa\";\nimport { logger } from \"../utils/logger.js\";\nimport { getCurrentBranch } from \"../lib/git.js\";\nimport { checkGhAuth } from \"../utils/validators.js\";\n\nexport async function githubRemoteCommand(): Promise<boolean> {\n const isAuthenticated = await checkGhAuth();\n if (!isAuthenticated) {\n logger.error(\"GitHub CLI is not authenticated. Run: gh auth login\");\n return false;\n }\n\n try {\n // Check if remote origin already exists\n try {\n const { stdout } = await execa(\"git\", [\n \"config\",\n \"--get\",\n \"remote.origin.url\",\n ]);\n if (stdout.trim()) {\n logger.error(\"Remote origin already exists: \" + stdout.trim());\n return false;\n }\n } catch {\n // No remote origin — expected\n }\n\n // Create a GitHub repo using gh CLI (uses current directory name)\n logger.info(\"Creating GitHub repository...\");\n await execa(\"gh\", [\"repo\", \"create\", \"--source=.\", \"--push\", \"--private\"]);\n\n const branch = await getCurrentBranch();\n logger.success(`Repository created and ${branch} pushed to GitHub`);\n return true;\n } catch (error) {\n logger.error(`Failed to create remote: ${error}`);\n return false;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,aAAa;AAKtB,eAAsB,sBAAwC;AAC5D,QAAM,kBAAkB,MAAM,YAAY;AAC1C,MAAI,CAAC,iBAAiB;AACpB,WAAO,MAAM,qDAAqD;AAClE,WAAO;AAAA,EACT;AAEA,MAAI;AAEF,QAAI;AACF,YAAM,EAAE,OAAO,IAAI,MAAM,MAAM,OAAO;AAAA,QACpC;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AACD,UAAI,OAAO,KAAK,GAAG;AACjB,eAAO,MAAM,mCAAmC,OAAO,KAAK,CAAC;AAC7D,eAAO;AAAA,MACT;AAAA,IACF,QAAQ;AAAA,IAER;AAGA,WAAO,KAAK,+BAA+B;AAC3C,UAAM,MAAM,MAAM,CAAC,QAAQ,UAAU,cAAc,UAAU,WAAW,CAAC;AAEzE,UAAM,SAAS,MAAM,iBAAiB;AACtC,WAAO,QAAQ,0BAA0B,MAAM,mBAAmB;AAClE,WAAO;AAAA,EACT,SAAS,OAAO;AACd,WAAO,MAAM,4BAA4B,KAAK,EAAE;AAChD,WAAO;AAAA,EACT;AACF;","names":[]}
|