Skip to content

Commit

Permalink
🔧 fix: make strict actually strict
Browse files Browse the repository at this point in the history
  • Loading branch information
Rettend committed Jan 26, 2024
1 parent 4b50b7c commit d1bcbf2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bin/hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
LOCAL_PATH=$(npm root)
NODE_PATH=$(npm root -g)
REPO_ROOT=$(git rev-parse --show-toplevel)
STATUS_FILE=".git/.eemoji-status"

if [ -f "$LOCAL_PATH/eemoji/bin/eemoji.mjs" ]; then
node "$LOCAL_PATH/eemoji/bin/eemoji.mjs" run $1
Expand All @@ -13,3 +14,9 @@ else
echo "eemoji is not properly installed locally or globally"
exit 1
fi

if [ -f "$STATUS_FILE" ]; then
ERROR_STATUS=$(cat "$STATUS_FILE")
rm "$STATUS_FILE"
if [ "$ERROR_STATUS" -eq "1" ]; then exit 1; fi
fi
3 changes: 2 additions & 1 deletion src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export default defineCommand({
}
}
catch (err: any) {
consola.error(err)
fs.writeFileSync(C.statusFile, '1')
consola.error(err.message)
}
},
})
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default defineDefaultConfig({
gitCommitFile = r('.git/COMMIT_EDITMSG')
hooksDir = r('.git/hooks')
hookFile = r('.git/hooks/prepare-commit-msg')
statusFile = r('.git/.eemoji-status')
entryDir = entryDir
entryFile = path.join(this.entryDir, 'hook.sh')
}
Expand Down

0 comments on commit d1bcbf2

Please sign in to comment.