summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2018-01-06 07:12:46 -0500
committerJacob Schatz <jschatz1@gmail.com>2018-01-06 07:12:46 -0500
commit406fe853049e9a4939c382e7e8467bec410e4d8d (patch)
treed1291a3b08530f6ae0c6bf7abb33707f4a56221a
parent99adec1d6400053886a88970297a0920459121fa (diff)
downloadgitlab-ce-prettier-eslint-rules.tar.gz
Adding prettier remover.prettier-eslint-rules
-rwxr-xr-xscripts/add-code-formatters3
-rwxr-xr-xscripts/remove-code-formatters19
2 files changed, 21 insertions, 1 deletions
diff --git a/scripts/add-code-formatters b/scripts/add-code-formatters
index 56bb8754d80..00099bdae69 100755
--- a/scripts/add-code-formatters
+++ b/scripts/add-code-formatters
@@ -14,5 +14,6 @@ if [ -L $PRECOMMIT ]; then
exit 1
fi
-ln -s ./pre-commit $PRECOMMIT
+ln -s ./scripts/pre-commit $PRECOMMIT
+chmod +x $PRECOMMIT
echo "Pre-commit script installed successfully"
diff --git a/scripts/remove-code-formatters b/scripts/remove-code-formatters
new file mode 100755
index 00000000000..58ef03a4913
--- /dev/null
+++ b/scripts/remove-code-formatters
@@ -0,0 +1,19 @@
+#!/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 not installed. Nothing to remove."
+ exit 1
+fi
+
+rm ./scripts/pre-commit $PRECOMMIT
+chmod +x $PRECOMMIT
+echo "Pre-commit script installed successfully"