diff --git a/src/git/doGitDiff.ts b/src/git/doGitDiff.ts new file mode 100644 index 00000000..8281a24f --- /dev/null +++ b/src/git/doGitDiff.ts @@ -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"); +} diff --git a/src/index.ts b/src/index.ts index be90664f..6ca9c322 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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";