@storm-software/git-tools 2.38.1 → 2.38.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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/bin/git.js +9 -14
- package/package.json +1 -1
- package/src/cli/index.js +9 -14
- package/src/index.js +9 -14
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
package/bin/git.js
CHANGED
|
@@ -232251,17 +232251,22 @@ var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
|
232251
232251
|
var runCommitLint = async (commitMessageArg) => {
|
|
232252
232252
|
const config2 = await loadStormConfig();
|
|
232253
232253
|
let commitMessage;
|
|
232254
|
-
if (
|
|
232254
|
+
if (commitMessageArg && commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
232255
|
+
commitMessage = commitMessageArg;
|
|
232256
|
+
} else if (commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
232257
|
+
commitMessage = await readCommitMessageFile();
|
|
232258
|
+
}
|
|
232259
|
+
if (!commitMessage) {
|
|
232255
232260
|
let gitLogCmd = "git log -1 --no-merges";
|
|
232256
232261
|
const gitRemotes = childProcess2.execSync("git remote -v").toString().trim().split("\n");
|
|
232257
232262
|
const upstreamRemote = gitRemotes.find(
|
|
232258
|
-
(remote) => remote.includes(`${config2.
|
|
232263
|
+
(remote) => remote.includes(`${config2.name}.git`)
|
|
232259
232264
|
);
|
|
232260
232265
|
if (upstreamRemote) {
|
|
232261
232266
|
const upstreamRemoteIdentifier = upstreamRemote.split(" ")[0]?.trim();
|
|
232262
232267
|
if (!upstreamRemoteIdentifier) {
|
|
232263
232268
|
throw new Error(
|
|
232264
|
-
`No upstream remote found for ${config2.
|
|
232269
|
+
`No upstream remote found for ${config2.name}.git. Skipping comparison.`
|
|
232265
232270
|
);
|
|
232266
232271
|
}
|
|
232267
232272
|
writeDebug(`Comparing against remote ${upstreamRemoteIdentifier}`);
|
|
@@ -232269,23 +232274,13 @@ var runCommitLint = async (commitMessageArg) => {
|
|
|
232269
232274
|
gitLogCmd = gitLogCmd + ` ${currentBranch} ^${upstreamRemoteIdentifier}/main`;
|
|
232270
232275
|
} else {
|
|
232271
232276
|
throw new Error(
|
|
232272
|
-
`No upstream remote found for ${config2.
|
|
232277
|
+
`No upstream remote found for ${config2.name}.git. Skipping comparison against upstream main.`
|
|
232273
232278
|
);
|
|
232274
232279
|
}
|
|
232275
232280
|
commitMessage = childProcess2.execSync(gitLogCmd).toString().trim();
|
|
232276
232281
|
if (!commitMessage) {
|
|
232277
232282
|
throw new Error("No commits found. Skipping commit message validation.");
|
|
232278
232283
|
}
|
|
232279
|
-
} else if (commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
232280
|
-
commitMessage = commitMessageArg;
|
|
232281
|
-
}
|
|
232282
|
-
if (!commitMessage) {
|
|
232283
|
-
commitMessage = await readCommitMessageFile();
|
|
232284
|
-
if (!commitMessage) {
|
|
232285
|
-
throw new Error(
|
|
232286
|
-
"No commit message found. Skipping commit message validation."
|
|
232287
|
-
);
|
|
232288
|
-
}
|
|
232289
232284
|
}
|
|
232290
232285
|
const allowedTypes = Object.keys(
|
|
232291
232286
|
config_default2.prompt.questions.type.enum
|
package/package.json
CHANGED
package/src/cli/index.js
CHANGED
|
@@ -228041,17 +228041,22 @@ var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
|
228041
228041
|
var runCommitLint = async (commitMessageArg) => {
|
|
228042
228042
|
const config2 = await loadStormConfig();
|
|
228043
228043
|
let commitMessage;
|
|
228044
|
-
if (
|
|
228044
|
+
if (commitMessageArg && commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
228045
|
+
commitMessage = commitMessageArg;
|
|
228046
|
+
} else if (commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
228047
|
+
commitMessage = await readCommitMessageFile();
|
|
228048
|
+
}
|
|
228049
|
+
if (!commitMessage) {
|
|
228045
228050
|
let gitLogCmd = "git log -1 --no-merges";
|
|
228046
228051
|
const gitRemotes = childProcess2.execSync("git remote -v").toString().trim().split("\n");
|
|
228047
228052
|
const upstreamRemote = gitRemotes.find(
|
|
228048
|
-
(remote) => remote.includes(`${config2.
|
|
228053
|
+
(remote) => remote.includes(`${config2.name}.git`)
|
|
228049
228054
|
);
|
|
228050
228055
|
if (upstreamRemote) {
|
|
228051
228056
|
const upstreamRemoteIdentifier = upstreamRemote.split(" ")[0]?.trim();
|
|
228052
228057
|
if (!upstreamRemoteIdentifier) {
|
|
228053
228058
|
throw new Error(
|
|
228054
|
-
`No upstream remote found for ${config2.
|
|
228059
|
+
`No upstream remote found for ${config2.name}.git. Skipping comparison.`
|
|
228055
228060
|
);
|
|
228056
228061
|
}
|
|
228057
228062
|
writeDebug(`Comparing against remote ${upstreamRemoteIdentifier}`);
|
|
@@ -228059,23 +228064,13 @@ var runCommitLint = async (commitMessageArg) => {
|
|
|
228059
228064
|
gitLogCmd = gitLogCmd + ` ${currentBranch} ^${upstreamRemoteIdentifier}/main`;
|
|
228060
228065
|
} else {
|
|
228061
228066
|
throw new Error(
|
|
228062
|
-
`No upstream remote found for ${config2.
|
|
228067
|
+
`No upstream remote found for ${config2.name}.git. Skipping comparison against upstream main.`
|
|
228063
228068
|
);
|
|
228064
228069
|
}
|
|
228065
228070
|
commitMessage = childProcess2.execSync(gitLogCmd).toString().trim();
|
|
228066
228071
|
if (!commitMessage) {
|
|
228067
228072
|
throw new Error("No commits found. Skipping commit message validation.");
|
|
228068
228073
|
}
|
|
228069
|
-
} else if (commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
228070
|
-
commitMessage = commitMessageArg;
|
|
228071
|
-
}
|
|
228072
|
-
if (!commitMessage) {
|
|
228073
|
-
commitMessage = await readCommitMessageFile();
|
|
228074
|
-
if (!commitMessage) {
|
|
228075
|
-
throw new Error(
|
|
228076
|
-
"No commit message found. Skipping commit message validation."
|
|
228077
|
-
);
|
|
228078
|
-
}
|
|
228079
228074
|
}
|
|
228080
228075
|
const allowedTypes = Object.keys(
|
|
228081
228076
|
config_default2.prompt.questions.type.enum
|
package/src/index.js
CHANGED
|
@@ -228143,17 +228143,22 @@ var COMMIT_EDITMSG_PATH = ".git/COMMIT_EDITMSG";
|
|
|
228143
228143
|
var runCommitLint = async (commitMessageArg) => {
|
|
228144
228144
|
const config2 = await loadStormConfig();
|
|
228145
228145
|
let commitMessage;
|
|
228146
|
-
if (
|
|
228146
|
+
if (commitMessageArg && commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
228147
|
+
commitMessage = commitMessageArg;
|
|
228148
|
+
} else if (commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
228149
|
+
commitMessage = await readCommitMessageFile();
|
|
228150
|
+
}
|
|
228151
|
+
if (!commitMessage) {
|
|
228147
228152
|
let gitLogCmd = "git log -1 --no-merges";
|
|
228148
228153
|
const gitRemotes = childProcess2.execSync("git remote -v").toString().trim().split("\n");
|
|
228149
228154
|
const upstreamRemote = gitRemotes.find(
|
|
228150
|
-
(remote) => remote.includes(`${config2.
|
|
228155
|
+
(remote) => remote.includes(`${config2.name}.git`)
|
|
228151
228156
|
);
|
|
228152
228157
|
if (upstreamRemote) {
|
|
228153
228158
|
const upstreamRemoteIdentifier = upstreamRemote.split(" ")[0]?.trim();
|
|
228154
228159
|
if (!upstreamRemoteIdentifier) {
|
|
228155
228160
|
throw new Error(
|
|
228156
|
-
`No upstream remote found for ${config2.
|
|
228161
|
+
`No upstream remote found for ${config2.name}.git. Skipping comparison.`
|
|
228157
228162
|
);
|
|
228158
228163
|
}
|
|
228159
228164
|
writeDebug(`Comparing against remote ${upstreamRemoteIdentifier}`);
|
|
@@ -228161,23 +228166,13 @@ var runCommitLint = async (commitMessageArg) => {
|
|
|
228161
228166
|
gitLogCmd = gitLogCmd + ` ${currentBranch} ^${upstreamRemoteIdentifier}/main`;
|
|
228162
228167
|
} else {
|
|
228163
228168
|
throw new Error(
|
|
228164
|
-
`No upstream remote found for ${config2.
|
|
228169
|
+
`No upstream remote found for ${config2.name}.git. Skipping comparison against upstream main.`
|
|
228165
228170
|
);
|
|
228166
228171
|
}
|
|
228167
228172
|
commitMessage = childProcess2.execSync(gitLogCmd).toString().trim();
|
|
228168
228173
|
if (!commitMessage) {
|
|
228169
228174
|
throw new Error("No commits found. Skipping commit message validation.");
|
|
228170
228175
|
}
|
|
228171
|
-
} else if (commitMessageArg !== COMMIT_EDITMSG_PATH) {
|
|
228172
|
-
commitMessage = commitMessageArg;
|
|
228173
|
-
}
|
|
228174
|
-
if (!commitMessage) {
|
|
228175
|
-
commitMessage = await readCommitMessageFile();
|
|
228176
|
-
if (!commitMessage) {
|
|
228177
|
-
throw new Error(
|
|
228178
|
-
"No commit message found. Skipping commit message validation."
|
|
228179
|
-
);
|
|
228180
|
-
}
|
|
228181
228176
|
}
|
|
228182
228177
|
const allowedTypes = Object.keys(
|
|
228183
228178
|
config_default2.prompt.questions.type.enum
|