diff --git a/.githooks/pre-commit b/.githooks/pre-commit deleted file mode 100755 index 161b5b6..0000000 --- a/.githooks/pre-commit +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# -# A hook script to verify that no filenames with capital letters are committed. -# Called by "git commit" with no arguments. The hook should -# exit with non-zero status after issuing an appropriate message if -# it wants to stop the commit. -# -# Go through all the changed files (except for deleted and unmerged) - -# Save exit code of last executed action -exit_code=0 - -# Check if file is one of SAS|DDL|CSV|SH and check for uppercase letters -mime_pattern="\.(sas|ddl|csv|sh)" -# Check for capital letters only in file names -extra_pattern="(^|/)[^/]*([A-Z]+)[^/]*\.[A-Za-z]{3}$" -# Grep git diff of files to commit -files=$( git diff --cached --find-copies --find-renames --name-only --diff-filter=ACMRTXBU | - grep -Ei "$mime_pattern" | - grep -E "$extra_pattern" ) -echo "$files" -if [[ -n "$files" ]]; -then - echo - echo "Found files that contain capital letters." - echo "Please rename the following files in lowercase, and commit again:" - - for file in $files; do - echo -e '- \E[0;32m'"$file"'\033[0m' - done - # Abort commit - exit_code=1 -fi - -if [ "$exit_code" == "0" ]; then - echo - echo -e '\033[1m'"Pre-commit validation Passed"'\033[0m' - echo -else - echo - echo -e '\033[1m'"Commit Aborted!"'\033[0m' - echo -fi -exit $exit_code \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 47f9701..3023ba5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -304,6 +304,14 @@ "dev": true, "requires": { "colors": "1.0.3" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + } } }, "clone": { @@ -328,9 +336,9 @@ "dev": true }, "colors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", - "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", "dev": true }, "combined-stream": { @@ -568,14 +576,6 @@ "requires": { "colors": "~0.6.0-1", "commander": "~2.1.0" - }, - "dependencies": { - "colors": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "dev": true - } } }, "follow-redirects": { diff --git a/package.json b/package.json index d367938..8629fbf 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "docs": "sasjs doc && ./sasjs/utils/build.sh", - "postinstall": "node-git-hooks" + "docs": "sasjs doc && ./sasjs/utils/build.sh" }, "devDependencies": { "@sasjs/cli": "^2.14.2",