@catladder/cli 0.0.0-main-e792d83e → 0.0.0-main-8ec1b61a
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/bundles/catenv/index.js +86 -13
- package/dist/bundles/cli/index.js +86 -13
- package/dist/cli/src/git/gitConfig.d.ts +9 -0
- package/dist/cli/src/git/gitConfig.js +16 -0
- package/dist/cli/src/git/gitConfig.js.map +1 -0
- package/dist/cli/src/git/gitProjectInformation.d.ts +16 -0
- package/dist/cli/src/git/gitProjectInformation.js +38 -0
- package/dist/cli/src/git/gitProjectInformation.js.map +1 -0
- package/dist/cli/src/git/index.d.ts +2 -0
- package/dist/cli/src/git/index.js +19 -0
- package/dist/cli/src/git/index.js.map +1 -0
- package/dist/cli/src/utils/gitlab.js +18 -13
- package/dist/cli/src/utils/gitlab.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/git/gitConfig.ts +32 -0
- package/src/git/gitProjectInformation.ts +40 -0
- package/src/git/index.ts +2 -0
- package/src/utils/gitlab.ts +19 -19
|
@@ -402,6 +402,74 @@ exports.parseChoice = parseChoice;
|
|
|
402
402
|
|
|
403
403
|
/***/ }),
|
|
404
404
|
|
|
405
|
+
/***/ 2745:
|
|
406
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
407
|
+
|
|
408
|
+
"use strict";
|
|
409
|
+
|
|
410
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
411
|
+
exports.gitConfigSet = exports.gitConfigGet = void 0;
|
|
412
|
+
const child_process_promise_1 = __nccwpck_require__(5763);
|
|
413
|
+
const argsJoin = (args) => args.filter(Boolean).join(" ");
|
|
414
|
+
async function gitConfigGet(key, { location } = {}) {
|
|
415
|
+
const { stdout } = await (0, child_process_promise_1.exec)(`git config get ${argsJoin([location ? `--${location}` : undefined])} ${key}`);
|
|
416
|
+
return stdout.trim();
|
|
417
|
+
}
|
|
418
|
+
exports.gitConfigGet = gitConfigGet;
|
|
419
|
+
const gitConfigSet = (key, value, { location, comment } = {}) => (0, child_process_promise_1.exec)(`git config set ${argsJoin([
|
|
420
|
+
location ? `--${location}` : undefined,
|
|
421
|
+
comment ? `--comment=${comment}` : undefined,
|
|
422
|
+
])} ${key} ${value}`);
|
|
423
|
+
exports.gitConfigSet = gitConfigSet;
|
|
424
|
+
//# sourceMappingURL=gitConfig.js.map
|
|
425
|
+
|
|
426
|
+
/***/ }),
|
|
427
|
+
|
|
428
|
+
/***/ 8329:
|
|
429
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
430
|
+
|
|
431
|
+
"use strict";
|
|
432
|
+
|
|
433
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
434
|
+
exports.gitProjectInformation = exports.getGitRemoteHostAndPath = exports.getProjectRootPath = void 0;
|
|
435
|
+
const gitConfig_1 = __nccwpck_require__(2745);
|
|
436
|
+
const child_process_promise_1 = __nccwpck_require__(5763);
|
|
437
|
+
/**
|
|
438
|
+
* Find the absolute path of the current git project root.
|
|
439
|
+
*/
|
|
440
|
+
const getProjectRootPath = async () => {
|
|
441
|
+
const { stdout } = await (0, child_process_promise_1.exec)(`git rev-parse --show-toplevel`);
|
|
442
|
+
return stdout.trim();
|
|
443
|
+
};
|
|
444
|
+
exports.getProjectRootPath = getProjectRootPath;
|
|
445
|
+
/**
|
|
446
|
+
* Get the git remote hostname and project path from the git config.
|
|
447
|
+
*/
|
|
448
|
+
const getGitRemoteHostAndPath = async () => {
|
|
449
|
+
var _a;
|
|
450
|
+
const remoteUrl = await (0, gitConfig_1.gitConfigGet)("remote.origin.url");
|
|
451
|
+
const remoteReg = /(https:\/\/|git@)([^:/]+)[:/]([^.]*)(\.git)?/;
|
|
452
|
+
const match = (_a = remoteUrl.match(remoteReg)) !== null && _a !== void 0 ? _a : [];
|
|
453
|
+
const [, , gitRemoteHost, gitRemotePath] = match;
|
|
454
|
+
if (!(gitRemoteHost === null || gitRemoteHost === void 0 ? void 0 : gitRemoteHost.length) || !(gitRemotePath === null || gitRemotePath === void 0 ? void 0 : gitRemotePath.length)) {
|
|
455
|
+
throw new Error(`Failed to parse git remote hostname and path from git configs remote.origin.url! ${remoteUrl}`);
|
|
456
|
+
}
|
|
457
|
+
return { gitRemoteHost, gitRemotePath };
|
|
458
|
+
};
|
|
459
|
+
exports.getGitRemoteHostAndPath = getGitRemoteHostAndPath;
|
|
460
|
+
const gitProjectInformation = async () => {
|
|
461
|
+
const [{ gitRemoteHost, gitRemotePath }, projectRootPath] = await Promise.all([(0, exports.getGitRemoteHostAndPath)(), (0, exports.getProjectRootPath)()]);
|
|
462
|
+
return {
|
|
463
|
+
gitRemoteHost,
|
|
464
|
+
gitRemotePath,
|
|
465
|
+
projectRootPath,
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
exports.gitProjectInformation = gitProjectInformation;
|
|
469
|
+
//# sourceMappingURL=gitProjectInformation.js.map
|
|
470
|
+
|
|
471
|
+
/***/ }),
|
|
472
|
+
|
|
405
473
|
/***/ 9863:
|
|
406
474
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
407
475
|
|
|
@@ -436,12 +504,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
436
504
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
437
505
|
exports.upsertAllVariables = exports.clearBackups = exports.getVariableValueByRawName = exports.getAllVariables = exports.getProjectInfo = exports.doGitlabRequest = exports.getGitlabToken = exports.setupGitlabToken = exports.hasGitlabToken = void 0;
|
|
438
506
|
const pipeline_1 = __nccwpck_require__(603);
|
|
439
|
-
const child_process_promise_1 = __nccwpck_require__(5763);
|
|
440
507
|
const lodash_1 = __nccwpck_require__(3255);
|
|
441
508
|
const memoizee_1 = __importDefault(__nccwpck_require__(5839));
|
|
442
509
|
const node_fetch_1 = __importDefault(__nccwpck_require__(6372));
|
|
443
510
|
const open_1 = __importDefault(__nccwpck_require__(4247));
|
|
444
511
|
const preferences_1 = __nccwpck_require__(2636);
|
|
512
|
+
const gitProjectInformation_1 = __nccwpck_require__(8329);
|
|
445
513
|
const TOKEN_KEY = "gitlab-personal-access-token";
|
|
446
514
|
const hasGitlabToken = async () => await (0, preferences_1.hasPreference)(TOKEN_KEY);
|
|
447
515
|
exports.hasGitlabToken = hasGitlabToken;
|
|
@@ -452,13 +520,16 @@ const setupGitlabToken = async (vorpal) => {
|
|
|
452
520
|
vorpal.log("");
|
|
453
521
|
vorpal.log("☝ we open up the settings page for you!");
|
|
454
522
|
vorpal.log("");
|
|
455
|
-
const { shouldContinue } = await
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
523
|
+
const [{ shouldContinue }, { gitRemoteHost }] = await Promise.all([
|
|
524
|
+
vorpal.prompt({
|
|
525
|
+
default: true,
|
|
526
|
+
message: "Ok",
|
|
527
|
+
name: "shouldContinue",
|
|
528
|
+
type: "prompt",
|
|
529
|
+
}),
|
|
530
|
+
(0, gitProjectInformation_1.getGitRemoteHostAndPath)(),
|
|
531
|
+
]);
|
|
532
|
+
(0, open_1.default)(`https://${gitRemoteHost}/-/profile/personal_access_tokens`);
|
|
462
533
|
vorpal.log("Please type in gitlab's personal access token");
|
|
463
534
|
const { personalToken } = await vorpal.prompt({
|
|
464
535
|
type: "string",
|
|
@@ -483,9 +554,12 @@ const getGitlabToken = async (vorpal) => {
|
|
|
483
554
|
};
|
|
484
555
|
exports.getGitlabToken = getGitlabToken;
|
|
485
556
|
const doGitlabRequest = async (vorpal, path, data = undefined, method = "GET") => {
|
|
486
|
-
const rootToken = await
|
|
557
|
+
const [rootToken, { gitRemoteHost }] = await Promise.all([
|
|
558
|
+
(0, exports.getGitlabToken)(vorpal),
|
|
559
|
+
(0, gitProjectInformation_1.getGitRemoteHostAndPath)(),
|
|
560
|
+
]);
|
|
487
561
|
//const method = data ? (update ? "PUT" : "POST") : "GET";
|
|
488
|
-
const result = await (0, node_fetch_1.default)(`https
|
|
562
|
+
const result = await (0, node_fetch_1.default)(`https://${gitRemoteHost}/api/v4/${path}`, {
|
|
489
563
|
method,
|
|
490
564
|
headers: {
|
|
491
565
|
"Content-Type": "application/json",
|
|
@@ -506,9 +580,8 @@ const doGitlabRequest = async (vorpal, path, data = undefined, method = "GET") =
|
|
|
506
580
|
};
|
|
507
581
|
exports.doGitlabRequest = doGitlabRequest;
|
|
508
582
|
const getProjectInfo = async (vorpal) => {
|
|
509
|
-
const
|
|
510
|
-
const
|
|
511
|
-
const project = await (0, exports.doGitlabRequest)(vorpal, `projects/${encodeURIComponent(projectPath[2])}`);
|
|
583
|
+
const { gitRemotePath } = await (0, gitProjectInformation_1.getGitRemoteHostAndPath)();
|
|
584
|
+
const project = await (0, exports.doGitlabRequest)(vorpal, `projects/${encodeURIComponent(gitRemotePath)}`);
|
|
512
585
|
return project;
|
|
513
586
|
};
|
|
514
587
|
exports.getProjectInfo = getProjectInfo;
|
|
@@ -2952,6 +2952,74 @@ const hash = (str, length) => {
|
|
|
2952
2952
|
|
|
2953
2953
|
/***/ }),
|
|
2954
2954
|
|
|
2955
|
+
/***/ 72745:
|
|
2956
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2957
|
+
|
|
2958
|
+
"use strict";
|
|
2959
|
+
|
|
2960
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2961
|
+
exports.gitConfigSet = exports.gitConfigGet = void 0;
|
|
2962
|
+
const child_process_promise_1 = __nccwpck_require__(75763);
|
|
2963
|
+
const argsJoin = (args) => args.filter(Boolean).join(" ");
|
|
2964
|
+
async function gitConfigGet(key, { location } = {}) {
|
|
2965
|
+
const { stdout } = await (0, child_process_promise_1.exec)(`git config get ${argsJoin([location ? `--${location}` : undefined])} ${key}`);
|
|
2966
|
+
return stdout.trim();
|
|
2967
|
+
}
|
|
2968
|
+
exports.gitConfigGet = gitConfigGet;
|
|
2969
|
+
const gitConfigSet = (key, value, { location, comment } = {}) => (0, child_process_promise_1.exec)(`git config set ${argsJoin([
|
|
2970
|
+
location ? `--${location}` : undefined,
|
|
2971
|
+
comment ? `--comment=${comment}` : undefined,
|
|
2972
|
+
])} ${key} ${value}`);
|
|
2973
|
+
exports.gitConfigSet = gitConfigSet;
|
|
2974
|
+
//# sourceMappingURL=gitConfig.js.map
|
|
2975
|
+
|
|
2976
|
+
/***/ }),
|
|
2977
|
+
|
|
2978
|
+
/***/ 78329:
|
|
2979
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2980
|
+
|
|
2981
|
+
"use strict";
|
|
2982
|
+
|
|
2983
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2984
|
+
exports.gitProjectInformation = exports.getGitRemoteHostAndPath = exports.getProjectRootPath = void 0;
|
|
2985
|
+
const gitConfig_1 = __nccwpck_require__(72745);
|
|
2986
|
+
const child_process_promise_1 = __nccwpck_require__(75763);
|
|
2987
|
+
/**
|
|
2988
|
+
* Find the absolute path of the current git project root.
|
|
2989
|
+
*/
|
|
2990
|
+
const getProjectRootPath = async () => {
|
|
2991
|
+
const { stdout } = await (0, child_process_promise_1.exec)(`git rev-parse --show-toplevel`);
|
|
2992
|
+
return stdout.trim();
|
|
2993
|
+
};
|
|
2994
|
+
exports.getProjectRootPath = getProjectRootPath;
|
|
2995
|
+
/**
|
|
2996
|
+
* Get the git remote hostname and project path from the git config.
|
|
2997
|
+
*/
|
|
2998
|
+
const getGitRemoteHostAndPath = async () => {
|
|
2999
|
+
var _a;
|
|
3000
|
+
const remoteUrl = await (0, gitConfig_1.gitConfigGet)("remote.origin.url");
|
|
3001
|
+
const remoteReg = /(https:\/\/|git@)([^:/]+)[:/]([^.]*)(\.git)?/;
|
|
3002
|
+
const match = (_a = remoteUrl.match(remoteReg)) !== null && _a !== void 0 ? _a : [];
|
|
3003
|
+
const [, , gitRemoteHost, gitRemotePath] = match;
|
|
3004
|
+
if (!(gitRemoteHost === null || gitRemoteHost === void 0 ? void 0 : gitRemoteHost.length) || !(gitRemotePath === null || gitRemotePath === void 0 ? void 0 : gitRemotePath.length)) {
|
|
3005
|
+
throw new Error(`Failed to parse git remote hostname and path from git configs remote.origin.url! ${remoteUrl}`);
|
|
3006
|
+
}
|
|
3007
|
+
return { gitRemoteHost, gitRemotePath };
|
|
3008
|
+
};
|
|
3009
|
+
exports.getGitRemoteHostAndPath = getGitRemoteHostAndPath;
|
|
3010
|
+
const gitProjectInformation = async () => {
|
|
3011
|
+
const [{ gitRemoteHost, gitRemotePath }, projectRootPath] = await Promise.all([(0, exports.getGitRemoteHostAndPath)(), (0, exports.getProjectRootPath)()]);
|
|
3012
|
+
return {
|
|
3013
|
+
gitRemoteHost,
|
|
3014
|
+
gitRemotePath,
|
|
3015
|
+
projectRootPath,
|
|
3016
|
+
};
|
|
3017
|
+
};
|
|
3018
|
+
exports.gitProjectInformation = gitProjectInformation;
|
|
3019
|
+
//# sourceMappingURL=gitProjectInformation.js.map
|
|
3020
|
+
|
|
3021
|
+
/***/ }),
|
|
3022
|
+
|
|
2955
3023
|
/***/ 79672:
|
|
2956
3024
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
2957
3025
|
|
|
@@ -3247,12 +3315,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3247
3315
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3248
3316
|
exports.upsertAllVariables = exports.clearBackups = exports.getVariableValueByRawName = exports.getAllVariables = exports.getProjectInfo = exports.doGitlabRequest = exports.getGitlabToken = exports.setupGitlabToken = exports.hasGitlabToken = void 0;
|
|
3249
3317
|
const pipeline_1 = __nccwpck_require__(10603);
|
|
3250
|
-
const child_process_promise_1 = __nccwpck_require__(75763);
|
|
3251
3318
|
const lodash_1 = __nccwpck_require__(23255);
|
|
3252
3319
|
const memoizee_1 = __importDefault(__nccwpck_require__(85839));
|
|
3253
3320
|
const node_fetch_1 = __importDefault(__nccwpck_require__(26372));
|
|
3254
3321
|
const open_1 = __importDefault(__nccwpck_require__(14247));
|
|
3255
3322
|
const preferences_1 = __nccwpck_require__(62636);
|
|
3323
|
+
const gitProjectInformation_1 = __nccwpck_require__(78329);
|
|
3256
3324
|
const TOKEN_KEY = "gitlab-personal-access-token";
|
|
3257
3325
|
const hasGitlabToken = async () => await (0, preferences_1.hasPreference)(TOKEN_KEY);
|
|
3258
3326
|
exports.hasGitlabToken = hasGitlabToken;
|
|
@@ -3263,13 +3331,16 @@ const setupGitlabToken = async (vorpal) => {
|
|
|
3263
3331
|
vorpal.log("");
|
|
3264
3332
|
vorpal.log("☝ we open up the settings page for you!");
|
|
3265
3333
|
vorpal.log("");
|
|
3266
|
-
const { shouldContinue } = await
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3334
|
+
const [{ shouldContinue }, { gitRemoteHost }] = await Promise.all([
|
|
3335
|
+
vorpal.prompt({
|
|
3336
|
+
default: true,
|
|
3337
|
+
message: "Ok",
|
|
3338
|
+
name: "shouldContinue",
|
|
3339
|
+
type: "prompt",
|
|
3340
|
+
}),
|
|
3341
|
+
(0, gitProjectInformation_1.getGitRemoteHostAndPath)(),
|
|
3342
|
+
]);
|
|
3343
|
+
(0, open_1.default)(`https://${gitRemoteHost}/-/profile/personal_access_tokens`);
|
|
3273
3344
|
vorpal.log("Please type in gitlab's personal access token");
|
|
3274
3345
|
const { personalToken } = await vorpal.prompt({
|
|
3275
3346
|
type: "string",
|
|
@@ -3294,9 +3365,12 @@ const getGitlabToken = async (vorpal) => {
|
|
|
3294
3365
|
};
|
|
3295
3366
|
exports.getGitlabToken = getGitlabToken;
|
|
3296
3367
|
const doGitlabRequest = async (vorpal, path, data = undefined, method = "GET") => {
|
|
3297
|
-
const rootToken = await
|
|
3368
|
+
const [rootToken, { gitRemoteHost }] = await Promise.all([
|
|
3369
|
+
(0, exports.getGitlabToken)(vorpal),
|
|
3370
|
+
(0, gitProjectInformation_1.getGitRemoteHostAndPath)(),
|
|
3371
|
+
]);
|
|
3298
3372
|
//const method = data ? (update ? "PUT" : "POST") : "GET";
|
|
3299
|
-
const result = await (0, node_fetch_1.default)(`https
|
|
3373
|
+
const result = await (0, node_fetch_1.default)(`https://${gitRemoteHost}/api/v4/${path}`, {
|
|
3300
3374
|
method,
|
|
3301
3375
|
headers: {
|
|
3302
3376
|
"Content-Type": "application/json",
|
|
@@ -3317,9 +3391,8 @@ const doGitlabRequest = async (vorpal, path, data = undefined, method = "GET") =
|
|
|
3317
3391
|
};
|
|
3318
3392
|
exports.doGitlabRequest = doGitlabRequest;
|
|
3319
3393
|
const getProjectInfo = async (vorpal) => {
|
|
3320
|
-
const
|
|
3321
|
-
const
|
|
3322
|
-
const project = await (0, exports.doGitlabRequest)(vorpal, `projects/${encodeURIComponent(projectPath[2])}`);
|
|
3394
|
+
const { gitRemotePath } = await (0, gitProjectInformation_1.getGitRemoteHostAndPath)();
|
|
3395
|
+
const project = await (0, exports.doGitlabRequest)(vorpal, `projects/${encodeURIComponent(gitRemotePath)}`);
|
|
3323
3396
|
return project;
|
|
3324
3397
|
};
|
|
3325
3398
|
exports.getProjectInfo = getProjectInfo;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type GitLocationScope = "global" | "local" | "system" | "worktree";
|
|
2
|
+
export type GitConfigOptions = {
|
|
3
|
+
location?: GitLocationScope;
|
|
4
|
+
comment?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function gitConfigGet(key: string, { location }?: Pick<GitConfigOptions, "location">): Promise<string>;
|
|
7
|
+
export declare const gitConfigSet: (key: string, value: string, { location, comment }?: GitConfigOptions) => Promise<{
|
|
8
|
+
stdout: string;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gitConfigSet = exports.gitConfigGet = void 0;
|
|
4
|
+
const child_process_promise_1 = require("child-process-promise");
|
|
5
|
+
const argsJoin = (args) => args.filter(Boolean).join(" ");
|
|
6
|
+
async function gitConfigGet(key, { location } = {}) {
|
|
7
|
+
const { stdout } = await (0, child_process_promise_1.exec)(`git config get ${argsJoin([location ? `--${location}` : undefined])} ${key}`);
|
|
8
|
+
return stdout.trim();
|
|
9
|
+
}
|
|
10
|
+
exports.gitConfigGet = gitConfigGet;
|
|
11
|
+
const gitConfigSet = (key, value, { location, comment } = {}) => (0, child_process_promise_1.exec)(`git config set ${argsJoin([
|
|
12
|
+
location ? `--${location}` : undefined,
|
|
13
|
+
comment ? `--comment=${comment}` : undefined,
|
|
14
|
+
])} ${key} ${value}`);
|
|
15
|
+
exports.gitConfigSet = gitConfigSet;
|
|
16
|
+
//# sourceMappingURL=gitConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitConfig.js","sourceRoot":"","sources":["../../../../src/git/gitConfig.ts"],"names":[],"mappings":";;;AAAA,iEAA6C;AAQ7C,MAAM,QAAQ,GAAG,CAAC,IAA4B,EAAU,EAAE,CACxD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE1B,KAAK,UAAU,YAAY,CAChC,GAAW,EACX,EAAE,QAAQ,KAAyC,EAAE;IAErD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,4BAAI,EAC3B,kBAAkB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,GAAG,EAAE,CAC9E,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC;AARD,oCAQC;AAEM,MAAM,YAAY,GAAG,CAC1B,GAAW,EACX,KAAa,EACb,EAAE,QAAQ,EAAE,OAAO,KAAuB,EAAE,EAC5C,EAAE,CACF,IAAA,4BAAI,EACF,kBAAkB,QAAQ,CAAC;IACzB,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;IACtC,OAAO,CAAC,CAAC,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;CAC7C,CAAC,IAAI,GAAG,IAAI,KAAK,EAAE,CACrB,CAAC;AAVS,QAAA,YAAY,gBAUrB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the absolute path of the current git project root.
|
|
3
|
+
*/
|
|
4
|
+
export declare const getProjectRootPath: () => Promise<string>;
|
|
5
|
+
/**
|
|
6
|
+
* Get the git remote hostname and project path from the git config.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getGitRemoteHostAndPath: () => Promise<{
|
|
9
|
+
gitRemoteHost: string;
|
|
10
|
+
gitRemotePath: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const gitProjectInformation: () => Promise<{
|
|
13
|
+
gitRemoteHost: string;
|
|
14
|
+
gitRemotePath: string;
|
|
15
|
+
projectRootPath: string;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gitProjectInformation = exports.getGitRemoteHostAndPath = exports.getProjectRootPath = void 0;
|
|
4
|
+
const gitConfig_1 = require("./gitConfig");
|
|
5
|
+
const child_process_promise_1 = require("child-process-promise");
|
|
6
|
+
/**
|
|
7
|
+
* Find the absolute path of the current git project root.
|
|
8
|
+
*/
|
|
9
|
+
const getProjectRootPath = async () => {
|
|
10
|
+
const { stdout } = await (0, child_process_promise_1.exec)(`git rev-parse --show-toplevel`);
|
|
11
|
+
return stdout.trim();
|
|
12
|
+
};
|
|
13
|
+
exports.getProjectRootPath = getProjectRootPath;
|
|
14
|
+
/**
|
|
15
|
+
* Get the git remote hostname and project path from the git config.
|
|
16
|
+
*/
|
|
17
|
+
const getGitRemoteHostAndPath = async () => {
|
|
18
|
+
var _a;
|
|
19
|
+
const remoteUrl = await (0, gitConfig_1.gitConfigGet)("remote.origin.url");
|
|
20
|
+
const remoteReg = /(https:\/\/|git@)([^:/]+)[:/]([^.]*)(\.git)?/;
|
|
21
|
+
const match = (_a = remoteUrl.match(remoteReg)) !== null && _a !== void 0 ? _a : [];
|
|
22
|
+
const [, , gitRemoteHost, gitRemotePath] = match;
|
|
23
|
+
if (!(gitRemoteHost === null || gitRemoteHost === void 0 ? void 0 : gitRemoteHost.length) || !(gitRemotePath === null || gitRemotePath === void 0 ? void 0 : gitRemotePath.length)) {
|
|
24
|
+
throw new Error(`Failed to parse git remote hostname and path from git configs remote.origin.url! ${remoteUrl}`);
|
|
25
|
+
}
|
|
26
|
+
return { gitRemoteHost, gitRemotePath };
|
|
27
|
+
};
|
|
28
|
+
exports.getGitRemoteHostAndPath = getGitRemoteHostAndPath;
|
|
29
|
+
const gitProjectInformation = async () => {
|
|
30
|
+
const [{ gitRemoteHost, gitRemotePath }, projectRootPath] = await Promise.all([(0, exports.getGitRemoteHostAndPath)(), (0, exports.getProjectRootPath)()]);
|
|
31
|
+
return {
|
|
32
|
+
gitRemoteHost,
|
|
33
|
+
gitRemotePath,
|
|
34
|
+
projectRootPath,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
exports.gitProjectInformation = gitProjectInformation;
|
|
38
|
+
//# sourceMappingURL=gitProjectInformation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitProjectInformation.js","sourceRoot":"","sources":["../../../../src/git/gitProjectInformation.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,iEAA6C;AAE7C;;GAEG;AACI,MAAM,kBAAkB,GAAG,KAAK,IAAqB,EAAE;IAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,4BAAI,EAAC,+BAA+B,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC,CAAC;AAHW,QAAA,kBAAkB,sBAG7B;AAEF;;GAEG;AACI,MAAM,uBAAuB,GAAG,KAAK,IAGzC,EAAE;;IACH,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,8CAA8C,CAAC;IACjE,MAAM,KAAK,GAAG,MAAA,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,mCAAI,EAAE,CAAC;IAC/C,MAAM,CAAC,EAAE,AAAD,EAAG,aAAa,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC;IACjD,IAAI,CAAC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAA,IAAI,CAAC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAA,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACb,oFAAoF,SAAS,EAAE,CAChG,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAC1C,CAAC,CAAC;AAdW,QAAA,uBAAuB,2BAclC;AAEK,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IAC9C,MAAM,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAC3E,CAAC,IAAA,+BAAuB,GAAE,EAAE,IAAA,0BAAkB,GAAE,CAAC,CAClD,CAAC;IACF,OAAO;QACL,aAAa;QACb,aAAa;QACb,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,qBAAqB,yBAShC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./gitConfig"), exports);
|
|
18
|
+
__exportStar(require("./gitProjectInformation"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/git/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,0DAAwC"}
|
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.upsertAllVariables = exports.clearBackups = exports.getVariableValueByRawName = exports.getAllVariables = exports.getProjectInfo = exports.doGitlabRequest = exports.getGitlabToken = exports.setupGitlabToken = exports.hasGitlabToken = void 0;
|
|
7
7
|
const pipeline_1 = require("../../../pipeline/src/index.js");
|
|
8
|
-
const child_process_promise_1 = require("child-process-promise");
|
|
9
8
|
const lodash_1 = require("lodash");
|
|
10
9
|
const memoizee_1 = __importDefault(require("memoizee"));
|
|
11
10
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
12
11
|
const open_1 = __importDefault(require("open"));
|
|
13
12
|
const preferences_1 = require("./preferences");
|
|
13
|
+
const gitProjectInformation_1 = require("../git/gitProjectInformation");
|
|
14
14
|
const TOKEN_KEY = "gitlab-personal-access-token";
|
|
15
15
|
const hasGitlabToken = async () => await (0, preferences_1.hasPreference)(TOKEN_KEY);
|
|
16
16
|
exports.hasGitlabToken = hasGitlabToken;
|
|
@@ -21,13 +21,16 @@ const setupGitlabToken = async (vorpal) => {
|
|
|
21
21
|
vorpal.log("");
|
|
22
22
|
vorpal.log("☝ we open up the settings page for you!");
|
|
23
23
|
vorpal.log("");
|
|
24
|
-
const { shouldContinue } = await
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
const [{ shouldContinue }, { gitRemoteHost }] = await Promise.all([
|
|
25
|
+
vorpal.prompt({
|
|
26
|
+
default: true,
|
|
27
|
+
message: "Ok",
|
|
28
|
+
name: "shouldContinue",
|
|
29
|
+
type: "prompt",
|
|
30
|
+
}),
|
|
31
|
+
(0, gitProjectInformation_1.getGitRemoteHostAndPath)(),
|
|
32
|
+
]);
|
|
33
|
+
(0, open_1.default)(`https://${gitRemoteHost}/-/profile/personal_access_tokens`);
|
|
31
34
|
vorpal.log("Please type in gitlab's personal access token");
|
|
32
35
|
const { personalToken } = await vorpal.prompt({
|
|
33
36
|
type: "string",
|
|
@@ -52,9 +55,12 @@ const getGitlabToken = async (vorpal) => {
|
|
|
52
55
|
};
|
|
53
56
|
exports.getGitlabToken = getGitlabToken;
|
|
54
57
|
const doGitlabRequest = async (vorpal, path, data = undefined, method = "GET") => {
|
|
55
|
-
const rootToken = await
|
|
58
|
+
const [rootToken, { gitRemoteHost }] = await Promise.all([
|
|
59
|
+
(0, exports.getGitlabToken)(vorpal),
|
|
60
|
+
(0, gitProjectInformation_1.getGitRemoteHostAndPath)(),
|
|
61
|
+
]);
|
|
56
62
|
//const method = data ? (update ? "PUT" : "POST") : "GET";
|
|
57
|
-
const result = await (0, node_fetch_1.default)(`https
|
|
63
|
+
const result = await (0, node_fetch_1.default)(`https://${gitRemoteHost}/api/v4/${path}`, {
|
|
58
64
|
method,
|
|
59
65
|
headers: {
|
|
60
66
|
"Content-Type": "application/json",
|
|
@@ -75,9 +81,8 @@ const doGitlabRequest = async (vorpal, path, data = undefined, method = "GET") =
|
|
|
75
81
|
};
|
|
76
82
|
exports.doGitlabRequest = doGitlabRequest;
|
|
77
83
|
const getProjectInfo = async (vorpal) => {
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const project = await (0, exports.doGitlabRequest)(vorpal, `projects/${encodeURIComponent(projectPath[2])}`);
|
|
84
|
+
const { gitRemotePath } = await (0, gitProjectInformation_1.getGitRemoteHostAndPath)();
|
|
85
|
+
const project = await (0, exports.doGitlabRequest)(vorpal, `projects/${encodeURIComponent(gitRemotePath)}`);
|
|
81
86
|
return project;
|
|
82
87
|
};
|
|
83
88
|
exports.getProjectInfo = getProjectInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../../src/utils/gitlab.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../../../src/utils/gitlab.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuD;AACvD,mCAAuC;AACvC,wDAAgC;AAChC,4DAA+B;AAC/B,gDAAwB;AAExB,+CAA4E;AAC5E,wEAAuE;AAEvE,MAAM,SAAS,GAAG,8BAA8B,CAAC;AAE1C,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE,CAAC,MAAM,IAAA,2BAAa,EAAC,SAAS,CAAC,CAAC;AAA5D,QAAA,cAAc,kBAA8C;AAClE,MAAM,gBAAgB,GAAG,KAAK,EAAE,MAAuB,EAAE,EAAE;IAChE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACf,MAAM,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC5E,MAAM,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;IAChE,MAAM,CAAC,GAAG,CAAC,EAAE,C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