Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
fix: if using from-package skip empty commits
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuhito committed May 1, 2022
1 parent 274706c commit 0828a53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class Publish extends Command {
await bumpWrite(checkedObjects);

await publishChecks(config);
await gitRun(config, checkedObjects);
await gitRun(config, checkedObjects, bumpArg);
await npmPublish(checkedObjects);
this.log(chalk.green("Successfully published all packages!"));
}
Expand Down
16 changes: 10 additions & 6 deletions src/publish/git-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ import type { BumpObject } from "../bump/bump";

const gitRun = async (
config: Config,
bumpObjects: BumpObject[]
bumpObjects: BumpObject[],
bumpArg: string
): Promise<void> => {
// Ensure all variables are ready before running git commands
const { name } = await getGitConfig(config);

// Stage all files
await gitAdd();
// Nothing to commit if no bumps are made
if (bumpArg !== "from-package") {
// Stage all files
await gitAdd();

// Commit
const updateMessage = commitHashUpdateMessage(config);
await gitCommit(updateMessage);
// Commit
const updateMessage = commitHashUpdateMessage(config);
await gitCommit(updateMessage);
}

// Update mass-publish.json with new commitFrom hash
await updateConfig(config);
Expand Down

0 comments on commit 0828a53

Please sign in to comment.