Skip to content

Commit

Permalink
[improves-views-sections] - update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelvilche committed Oct 10, 2021
1 parent 3f344cf commit 11cd660
Show file tree
Hide file tree
Showing 5 changed files with 955 additions and 1,153 deletions.
37 changes: 37 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

#
# Automatically adds branch name and branch description to every commit message.
#
RCol='\e[0m' # Text Reset
Red='\e[0;31m' # Red

NAME=$(git branch | grep '*' | sed 's/* //')
DESCRIPTION=$(git config branch."$NAME".description)

COMMIT_MESSAGE_FILE=$1

if [ -z $COMMIT_MESSAGE_FILE ] || [ ! -f $COMMIT_MESSAGE_FILE ]; then
echo "Commit message file not found: $COMMIT_MESSAGE_FILE"
exit 1
fi

FIRST_LINE=$(head -n 1 $COMMIT_MESSAGE_FILE)
FIRST_LETTER=${FIRST_LINE:0:1}

if [ -z "$FIRST_LINE" ] || [ "$FIRST_LETTER" == "#" ]; then
echo -e "\n${Red}Empty commit message file. You need to set your commit message!${RCol}\n"
exit 1
fi

grep -q '\['$NAME'\]' $COMMIT_MESSAGE_FILE

if [[ $? -ne 0 ]]; then
echo -n "[$NAME]"' - '|cat - "$COMMIT_MESSAGE_FILE" > /tmp/out && mv /tmp/out "$COMMIT_MESSAGE_FILE"

if [ -n "$DESCRIPTION" ]
then
echo "" >> "$COMMIT_MESSAGE_FILE"
echo $DESCRIPTION >> "$COMMIT_MESSAGE_FILE"
fi
fi
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

npm run lint && npm t
5 changes: 0 additions & 5 deletions .huskyrc.json

This file was deleted.

0 comments on commit 11cd660

Please sign in to comment.