Merge branch 'revert-c8ddf067' into 'master'
Revert "Merge branch 'pre-commit-prettier' into 'master'" See merge request gitlab-org/gitlab-ce!16217
This commit is contained in:
commit
d7eb369218
|
@ -1,18 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Check if file exists with -f. Check if in in the gdk rook directory.
|
||||
if [ ! -f ../GDK_ROOT ]; then
|
||||
echo "Please run script from gitlab (e.g. gitlab-development-kit/gitlab) root directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PRECOMMIT=$(git rev-parse --git-dir)/hooks/pre-commit
|
||||
|
||||
# Check if symlink exists with -L. Check if script was already installed.
|
||||
if [ -L $PRECOMMIT ]; then
|
||||
echo "Pre-commit script already installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ln -s ./pre-commit $PRECOMMIT
|
||||
echo "Pre-commit script installed successfully"
|
|
@ -1,18 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Check if file exists with -f. Check if in in the gdk rook directory.
|
||||
if [ ! -f ../GDK_ROOT ]; then
|
||||
echo "Please run pre-commit from gitlab (e.g. gitlab-development-kit/gitlab) root directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jsfiles=$(git diff --cached --name-only --diff-filter=ACM "*.js" | tr '\n' ' ')
|
||||
[ -z "$jsfiles" ] && exit 0
|
||||
|
||||
# Prettify all staged .js files
|
||||
echo "$jsfiles" | xargs ./node_modules/.bin/prettier --write
|
||||
|
||||
# Add back the modified/prettified files to staging
|
||||
echo "$jsfiles" | xargs git add
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue