Skip to content

Commit 2388c75

Browse files
committed
Add license logging
1 parent cd6bcd3 commit 2388c75

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

tools/gitHooks/license.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,24 @@ async function doLicenseCommit(changedFiles) {
116116

117117
const hasDiff = await git.diff();
118118

119-
if (!hasDiff) return;
119+
if (!hasDiff) {
120+
console.log(
121+
chalk`\n{red License pass caused no changes.} Skipping commit.\n`
122+
);
123+
return;
124+
}
120125

121126
const gitSpinner = ora(' Creating automated license commit').start();
122127
await git.add('.');
123128

124-
await git.commit('[AUTOMATED]: License Headers');
129+
const commit = await git.commit('[AUTOMATED]: License Headers');
125130

126131
gitSpinner.stopAndPersist({
127132
symbol: '✅'
128133
});
134+
console.log(
135+
chalk`{green Commited ${commit.commit} to branch ${commit.branch}}`
136+
);
129137
}
130138

131139
module.exports = {

tools/gitHooks/prettier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async function doPrettierCommit(changedFiles) {
105105
symbol: '✅'
106106
});
107107
console.log(
108-
chalk`\n{green Commited ${commit.commit} to branch ${commit.branch}}`
108+
chalk`{green Commited ${commit.commit} to branch ${commit.branch}}`
109109
);
110110
}
111111

0 commit comments

Comments
 (0)