Skip to content

Commit

Permalink
Log details about each package update in commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Anifacted committed Feb 1, 2018
1 parent e7f14d4 commit 6478faa
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/wizards/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,23 @@ module.exports = async ({
}

if (shouldCreateGitCommit) {
const createCmd = `git add . && git commit -m '${gitCommitMessage}'`;
const subMessage = targetPackages
.reduce((prev, pack) => {
const fromVersion = dependencyMap[targetDependency].packs[pack];

if (fromVersion === targetVersion) return prev;

return fromVersion
? [...prev, `* ${pack}: ${fromVersion}${targetVersion}`]
: [...prev, `* ${pack}: ${targetVersion}`];
}, [])
.join("\n");

const createCmd = `git add . && git commit -m '${gitCommitMessage}' -m '${subMessage}'`;
await runCommand(`cd ${projectDir} && ${createCmd}`, {
startMessage: `${chalk.white.bold(projectName)}: ${createCmd}`,
endMessage: chalk.green(`Commit created ✓`)
endMessage: chalk.green(`Commit created ✓`),
logOutput: false
});
}
};

0 comments on commit 6478faa

Please sign in to comment.