@release-change/git 0.2.0 → 0.2.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/dist/cancel-commits-since-ref.d.ts.map +1 -1
- package/dist/cancel-commits-since-ref.js +4 -3
- package/dist/cancel-commits-since-ref.js.map +1 -1
- package/dist/check-authorisation.d.ts.map +1 -1
- package/dist/check-authorisation.js +5 -5
- package/dist/check-authorisation.js.map +1 -1
- package/dist/delete-branch-on-remote-repository.d.ts.map +1 -1
- package/dist/delete-branch-on-remote-repository.js +4 -3
- package/dist/delete-branch-on-remote-repository.js.map +1 -1
- package/dist/push.d.ts.map +1 -1
- package/dist/push.js +5 -5
- package/dist/push.js.map +1 -1
- package/dist/remove-tag-on-remote-repository.d.ts.map +1 -1
- package/dist/remove-tag-on-remote-repository.js +4 -3
- package/dist/remove-tag-on-remote-repository.js.map +1 -1
- package/dist/remove-tag.d.ts.map +1 -1
- package/dist/remove-tag.js +4 -3
- package/dist/remove-tag.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-commits-since-ref.d.ts","sourceRoot":"","sources":["../src/cancel-commits-since-ref.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cancel-commits-since-ref.d.ts","sourceRoot":"","sources":["../src/cancel-commits-since-ref.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,EAAE,KAAK,MAAM,EAAE,eAAa,KAAG,IA8BrF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setLogger } from "@release-change/logger";
|
|
2
|
-
import { formatDetailedError, runCommandSync } from "@release-change/shared";
|
|
2
|
+
import { formatDetailedError, formatOutputFromCommandResult, runCommandSync } from "@release-change/shared";
|
|
3
3
|
/**
|
|
4
4
|
* Cancels the commits since the commit reference.
|
|
5
5
|
* @param commitRef - The reference of the commit after which all the commits are to be cancelled.
|
|
@@ -11,7 +11,8 @@ export const cancelCommitsSinceRef = (commitRef, cwd, debug = false) => {
|
|
|
11
11
|
logger.setScope("git");
|
|
12
12
|
if (commitRef) {
|
|
13
13
|
const args = ["reset", "--hard", commitRef];
|
|
14
|
-
const
|
|
14
|
+
const commandResult = runCommandSync("git", args, { cwd });
|
|
15
|
+
const { status } = commandResult;
|
|
15
16
|
if (debug) {
|
|
16
17
|
logger.setDebugScope("git:cancel-commits-since-ref");
|
|
17
18
|
logger.logDebug(`Command run: git ${args.join(" ")}`);
|
|
@@ -22,7 +23,7 @@ export const cancelCommitsSinceRef = (commitRef, cwd, debug = false) => {
|
|
|
22
23
|
title: "Failed to run the `git reset` command",
|
|
23
24
|
message: `The command failed with status ${status}.`,
|
|
24
25
|
details: {
|
|
25
|
-
output:
|
|
26
|
+
output: formatOutputFromCommandResult(commandResult),
|
|
26
27
|
command: `git ${args.join(" ")}`
|
|
27
28
|
}
|
|
28
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cancel-commits-since-ref.js","sourceRoot":"","sources":["../src/cancel-commits-since-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"cancel-commits-since-ref.js","sourceRoot":"","sources":["../src/cancel-commits-since-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EACf,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAE,GAAW,EAAE,KAAK,GAAG,KAAK,EAAQ,EAAE;IAC3F,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC5C,MAAM,aAAa,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC3D,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;QACjC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,aAAa,CAAC,8BAA8B,CAAC,CAAC;YACrD,MAAM,CAAC,QAAQ,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,QAAQ,CAAC,sCAAsC,SAAS,GAAG,CAAC,CAAC;YACpE,MAAM,mBAAmB,CAAC;gBACxB,KAAK,EAAE,uCAAuC;gBAC9C,OAAO,EAAE,kCAAkC,MAAM,GAAG;gBACpD,OAAO,EAAE;oBACP,MAAM,EAAE,6BAA6B,CAAC,aAAa,CAAC;oBACpD,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;iBACjC;aACF,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,iBAAiB,SAAS,aAAa,CAAC,CAAC;IAC1D,CAAC;SAAM,CAAC;QACN,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,0BAA0B;YACjC,OAAO,EAAE,yCAAyC;YAClD,OAAO,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE;SACnC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-authorisation.d.ts","sourceRoot":"","sources":["../src/check-authorisation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"check-authorisation.d.ts","sourceRoot":"","sources":["../src/check-authorisation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAUtD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,eAAe,MAAM,EACrB,SAAS,OAAO,KACf,OAAO,CAAC,IAAI,CA0Bd,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setLogger } from "@release-change/logger";
|
|
2
|
-
import { deepInspectObject, formatDetailedError, runCommand } from "@release-change/shared";
|
|
2
|
+
import { deepInspectObject, formatDetailedError, formatOutputFromCommandResult, runCommand } from "@release-change/shared";
|
|
3
3
|
/**
|
|
4
4
|
* Checks the authorisation to push commits to the remote repository.
|
|
5
5
|
* @param repositoryUrl - The repository URL.
|
|
@@ -14,19 +14,19 @@ export const checkAuthorisation = async (repositoryUrl, context) => {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
const args = ["push", "--dry-run", "--no-verify", repositoryUrl, branch];
|
|
17
|
-
const
|
|
17
|
+
const commandResult = await runCommand("git", args, { cwd });
|
|
18
18
|
if (config.debug) {
|
|
19
19
|
logger.setDebugScope("git:check-authorisation");
|
|
20
|
-
logger.logDebug(deepInspectObject(
|
|
20
|
+
logger.logDebug(deepInspectObject(commandResult));
|
|
21
21
|
}
|
|
22
|
-
const { status
|
|
22
|
+
const { status } = commandResult;
|
|
23
23
|
if (status) {
|
|
24
24
|
process.exitCode = status;
|
|
25
25
|
throw formatDetailedError({
|
|
26
26
|
title: "Failed to run the `git push` command",
|
|
27
27
|
message: `The command failed with status ${status}.`,
|
|
28
28
|
details: {
|
|
29
|
-
output:
|
|
29
|
+
output: formatOutputFromCommandResult(commandResult),
|
|
30
30
|
command: `git ${args.join(" ")}`
|
|
31
31
|
}
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-authorisation.js","sourceRoot":"","sources":["../src/check-authorisation.ts"],"names":[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,CAAC;QAC1B,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,sCAAsC;YAC7C,OAAO,EAAE,kCAAkC,MAAM,GAAG;YACpD,OAAO,EAAE;gBACP,MAAM,EAAE,6BAA6B,CAAC,aAAa,CAAC;gBACpD,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;aACjC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-branch-on-remote-repository.d.ts","sourceRoot":"","sources":["../src/delete-branch-on-remote-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"delete-branch-on-remote-repository.d.ts","sourceRoot":"","sources":["../src/delete-branch-on-remote-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAStD;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GACzC,QAAQ,MAAM,EACd,SAAS,OAAO,KACf,OAAO,CAAC,IAAI,CAiCd,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setLogger } from "@release-change/logger";
|
|
2
|
-
import { formatDetailedError, runCommand } from "@release-change/shared";
|
|
2
|
+
import { formatDetailedError, formatOutputFromCommandResult, runCommand } from "@release-change/shared";
|
|
3
3
|
/**
|
|
4
4
|
* Deletes a branch on a remote repository.
|
|
5
5
|
* @param branch - The name of the branch to delete.
|
|
@@ -11,7 +11,8 @@ export const deleteBranchOnRemoteRepository = async (branch, context) => {
|
|
|
11
11
|
logger.setScope("git");
|
|
12
12
|
if (branch) {
|
|
13
13
|
const args = ["push", "--delete", remoteName, branch];
|
|
14
|
-
const
|
|
14
|
+
const commandResult = await runCommand("git", args);
|
|
15
|
+
const { status } = commandResult;
|
|
15
16
|
if (debug) {
|
|
16
17
|
logger.setDebugScope("git:delete-remote-branch");
|
|
17
18
|
logger.logDebug(`Command run: git ${args.join(" ")}`);
|
|
@@ -22,7 +23,7 @@ export const deleteBranchOnRemoteRepository = async (branch, context) => {
|
|
|
22
23
|
title: "Failed to run the `git push` command",
|
|
23
24
|
message: `The command failed with status ${status}.`,
|
|
24
25
|
details: {
|
|
25
|
-
output:
|
|
26
|
+
output: formatOutputFromCommandResult(commandResult),
|
|
26
27
|
command: `git ${args.join(" ")}`
|
|
27
28
|
}
|
|
28
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-branch-on-remote-repository.js","sourceRoot":"","sources":["../src/delete-branch-on-remote-repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"delete-branch-on-remote-repository.js","sourceRoot":"","sources":["../src/delete-branch-on-remote-repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,UAAU,EACX,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,KAAK,EACjD,MAAc,EACd,OAAgB,EACD,EAAE;IACjB,MAAM,EACJ,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAC9B,GAAG,OAAO,CAAC;IACZ,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QACtD,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACpD,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;QACjC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;YACjD,MAAM,CAAC,QAAQ,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,QAAQ,CAAC,oCAAoC,MAAM,OAAO,UAAU,GAAG,CAAC,CAAC;YAChF,MAAM,mBAAmB,CAAC;gBACxB,KAAK,EAAE,sCAAsC;gBAC7C,OAAO,EAAE,kCAAkC,MAAM,GAAG;gBACpD,OAAO,EAAE;oBACP,MAAM,EAAE,6BAA6B,CAAC,aAAa,CAAC;oBACpD,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;iBACjC;aACF,CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,yBAAyB,MAAM,gBAAgB,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,gDAAgD;YACvD,OAAO,EAAE,oCAAoC;YAC7C,OAAO,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
package/dist/push.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAUlD;;;;GAIG;AACH,eAAO,MAAM,IAAI,GAAU,SAAS,OAAO,EAAE,aAAa,WAAW,KAAG,OAAO,CAAC,IAAI,CAqCnF,CAAC"}
|
package/dist/push.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setLogger } from "@release-change/logger";
|
|
2
|
-
import { deepInspectObject, formatDetailedError, runCommand } from "@release-change/shared";
|
|
2
|
+
import { deepInspectObject, formatDetailedError, formatOutputFromCommandResult, runCommand } from "@release-change/shared";
|
|
3
3
|
/**
|
|
4
4
|
* Pushes the current branch to the remote repository.
|
|
5
5
|
* @param context - The context where the CLI is running.
|
|
@@ -22,15 +22,15 @@ export const push = async (context, pushOptions) => {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
const args = ["push", includeTags && "--follow-tags", remoteName, destinationBranch].filter(arg => typeof arg === "string");
|
|
25
|
-
const
|
|
26
|
-
const { status
|
|
25
|
+
const commandResult = await runCommand("git", args);
|
|
26
|
+
const { status } = commandResult;
|
|
27
27
|
if (status) {
|
|
28
28
|
process.exitCode = status;
|
|
29
29
|
throw formatDetailedError({
|
|
30
30
|
title: "Failed to run the `git push` command",
|
|
31
31
|
message: `The command failed with status ${status}.`,
|
|
32
32
|
details: {
|
|
33
|
-
output:
|
|
33
|
+
output: formatOutputFromCommandResult(commandResult),
|
|
34
34
|
command: `git ${args.join(" ")}`
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -38,7 +38,7 @@ export const push = async (context, pushOptions) => {
|
|
|
38
38
|
if (debug) {
|
|
39
39
|
logger.setDebugScope("git:push");
|
|
40
40
|
logger.logDebug(`Command run: git ${args.join(" ")}`);
|
|
41
|
-
logger.logDebug(deepInspectObject(
|
|
41
|
+
logger.logDebug(deepInspectObject(commandResult));
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=push.js.map
|
package/dist/push.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.js","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,UAAU,EACX,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EAAE,OAAgB,EAAE,WAAwB,EAAiB,EAAE;IACtF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;IACvD,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,sCAAsC;YAC7C,OAAO,EAAE,iCAAiC;YAC1C,OAAO,EAAE;gBACP,MAAM,EAAE,qBAAqB;aAC9B;SACF,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,IAAI,eAAe,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,MAAM,CACzF,GAAG,CAAC,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,CAC/B,CAAC;IACF,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpD,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;IACjC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC1B,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,sCAAsC;YAC7C,OAAO,EAAE,kCAAkC,MAAM,GAAG;YACpD,OAAO,EAAE;gBACP,MAAM,EAAE,6BAA6B,CAAC,aAAa,CAAC;gBACpD,OAAO,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;aACjC;SACF,CAAC,CAAC;IACL,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtD,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC;IACpD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tag-on-remote-repository.d.ts","sourceRoot":"","sources":["../src/remove-tag-on-remote-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"remove-tag-on-remote-repository.d.ts","sourceRoot":"","sources":["../src/remove-tag-on-remote-repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAStD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GACtC,QAAQ,MAAM,EACd,SAAS,OAAO,KACf,OAAO,CAAC,IAAI,CAiCd,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setLogger } from "@release-change/logger";
|
|
2
|
-
import { formatDetailedError, runCommand } from "@release-change/shared";
|
|
2
|
+
import { formatDetailedError, formatOutputFromCommandResult, runCommand } from "@release-change/shared";
|
|
3
3
|
/**
|
|
4
4
|
* Removes a Git tag on a remote repository.
|
|
5
5
|
* @param gitTag - The Git tag to remove.
|
|
@@ -11,7 +11,8 @@ export const removeTagOnRemoteRepository = async (gitTag, context) => {
|
|
|
11
11
|
logger.setScope("git");
|
|
12
12
|
if (gitTag) {
|
|
13
13
|
const args = ["push", "--delete", remoteName, gitTag];
|
|
14
|
-
const
|
|
14
|
+
const commandResult = await runCommand("git", args);
|
|
15
|
+
const { status } = commandResult;
|
|
15
16
|
if (debug) {
|
|
16
17
|
logger.setDebugScope("git:remove-tag-on-remote-repository");
|
|
17
18
|
logger.logDebug(`Command run: git ${args.join(" ")}`);
|
|
@@ -22,7 +23,7 @@ export const removeTagOnRemoteRepository = async (gitTag, context) => {
|
|
|
22
23
|
title: "Failed to run the `git push` command",
|
|
23
24
|
message: `The command failed with status ${status}.`,
|
|
24
25
|
details: {
|
|
25
|
-
output:
|
|
26
|
+
output: formatOutputFromCommandResult(commandResult),
|
|
26
27
|
command: `git ${args.join(" ")}`
|
|
27
28
|
}
|
|
28
29
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tag-on-remote-repository.js","sourceRoot":"","sources":["../src/remove-tag-on-remote-repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"remove-tag-on-remote-repository.js","sourceRoot":"","sources":["../src/remove-tag-on-remote-repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,UAAU,EACX,MAAM,wBAAwB,CAAC;AAEhC;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAC9C,MAAc,EACd,OAAgB,EACD,EAAE;IACjB,MAAM,EACJ,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAC9B,GA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":3,"file":"remove-tag.d.ts","sourceRoot":"","sources":["../src/remove-tag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remove-tag.d.ts","sourceRoot":"","sources":["../src/remove-tag.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,KAAK,MAAM,EAAE,eAAa,KAAG,IA8BtE,CAAC"}
|
package/dist/remove-tag.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setLogger } from "@release-change/logger";
|
|
2
|
-
import { formatDetailedError, runCommandSync } from "@release-change/shared";
|
|
2
|
+
import { formatDetailedError, formatOutputFromCommandResult, runCommandSync } from "@release-change/shared";
|
|
3
3
|
/**
|
|
4
4
|
* Removes a Git tag.
|
|
5
5
|
* @param gitTag - The Git tag to remove.
|
|
@@ -11,7 +11,8 @@ export const removeTag = (gitTag, cwd, debug = false) => {
|
|
|
11
11
|
logger.setScope("git");
|
|
12
12
|
if (gitTag) {
|
|
13
13
|
const args = ["tag", "-d", gitTag];
|
|
14
|
-
const
|
|
14
|
+
const commandResult = runCommandSync("git", args, { cwd });
|
|
15
|
+
const { status } = commandResult;
|
|
15
16
|
if (debug) {
|
|
16
17
|
logger.setDebugScope("git:remove-tag");
|
|
17
18
|
logger.logDebug(`Command run: git ${args.join(" ")}`);
|
|
@@ -22,7 +23,7 @@ export const removeTag = (gitTag, cwd, debug = false) => {
|
|
|
22
23
|
title: "Failed to run the `git tag` command",
|
|
23
24
|
message: `The command failed with status ${status}.`,
|
|
24
25
|
details: {
|
|
25
|
-
output:
|
|
26
|
+
output: formatOutputFromCommandResult(commandResult),
|
|
26
27
|
command: `git ${args.join(" ")}`
|
|
27
28
|
}
|
|
28
29
|
});
|
package/dist/remove-tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-tag.js","sourceRoot":"","sources":["../src/remove-tag.ts"],"names":[],"mappings":"AAAA,OAAO,E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CAAC,CAAC;QACL,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,mBAAmB,MAAM,GAAG,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,4BAA4B;YACnC,OAAO,EAAE,gCAAgC;YACzC,OAAO,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@release-change/git",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Functions used internally in release-change to make Git operations easier",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/release-change/release-change",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": "^20.18.3 || ^22.12.0 || ^24.0.0",
|
|
26
26
|
"npm": ">=10.8.2",
|
|
27
|
-
"pnpm": ">=10.
|
|
27
|
+
"pnpm": ">=10.32.1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@release-change/commit-analyser": "0.1.
|
|
31
|
-
"@release-change/
|
|
32
|
-
"@release-change/
|
|
33
|
-
"@release-change/
|
|
30
|
+
"@release-change/commit-analyser": "0.1.4",
|
|
31
|
+
"@release-change/semver": "0.1.0",
|
|
32
|
+
"@release-change/shared": "0.1.3",
|
|
33
|
+
"@release-change/logger": "0.1.3"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsc",
|