Skip to content

Commit

Permalink
feat: add git diff command (#201)
Browse files Browse the repository at this point in the history
[MHUB-422]
Redo with semantic-commit

Co-authored-by: Sam Thomas <10165959+samuelfullerthomas@users.noreply.github.com>
  • Loading branch information
louis-bompart and samuelfullerthomas committed Nov 29, 2023
1 parent 42a327b commit 551b98e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/git/doGitDiff.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import spawn from "../utils/spawn.js";
import gitLogger from "./utils/gitLogger.js";

export default async function gitDiff() {
return (
await spawn("git", ["--no-pager", "diff", "--name-only"], gitLogger)
).stdout
.trim()
.split("\n");
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export { default as gitSetRefOnCommit } from "./git/doGitSetRefOnCommit.js";
export { default as gitDeleteRemoteBranch } from "./git/doGitPushDelete.js";
export { default as gitPublishBranch } from "./git/doGitPublishBranch.js";
export { default as gitReset } from "./git/doGitReset.js";
export { default as gitDiff } from "./git/doGitDiff.js";

export { default as npmBumpVersion } from "./npm/doNpmBumpVersion.js";
export { default as npmPublish } from "./npm/doNpmPublish.js";
Expand Down

0 comments on commit 551b98e

Please sign in to comment.