Skip to content

Commit

Permalink
Merge pull request #9 from fubhy/master
Browse files Browse the repository at this point in the history
Switch to bin/bash since we are using a bash extension and use -f ins…
  • Loading branch information
okonet committed May 1, 2016
2 parents 46a7594 + 61005bf commit 6ae2d98
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions scripts/eslint-staged.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh
#!/bin/bash

executable=node_modules/.bin/staged-files
executable=$(npm bin)/staged-files
linter_name="eslint"
linter_path=./node_modules/.bin/eslint
linter_path=$(npm bin)/eslint
lint_extensions="**/*.@(js|jsx)"

if [[ -e "${linter_path}" ]]; then
if [[ -f "${linter_path}" ]]; then
echo "Running ${linter_name} on git staged files: ${lint_extensions}"
${executable} "${lint_extensions}" -- ${linter_path}
else
Expand Down
8 changes: 4 additions & 4 deletions scripts/flow-staged.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh
#!/bin/bash

executable=node_modules/.bin/staged-files
executable=$(npm bin)/staged-files
linter_name="flow"
linter_path=flow
linter_path=$(npm bin)/flow
lint_extensions="**/*.@(js|jsx)"

if [[ -e "${linter_path}" ]]; then
if [[ -f "${linter_path}" ]]; then
echo "Running ${linter_name} on git staged files: ${lint_extensions}"
${executable} "${lint_extensions}" -- ${linter_path}
else
Expand Down
8 changes: 4 additions & 4 deletions scripts/jscs-staged.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh
#!/bin/bash

executable=node_modules/.bin/staged-files
executable=$(npm bin)/staged-files
linter_name="jscs"
linter_path=./node_modules/.bin/jscs
linter_path=$(npm bin)/jscs
lint_extensions="**/*.@(js|jsx)"

if [[ -e "${linter_path}" ]]; then
if [[ -f "${linter_path}" ]]; then
echo "Running ${linter_name} on git staged files: ${lint_extensions}"
${executable} "${lint_extensions}" -- ${linter_path}
else
Expand Down
8 changes: 4 additions & 4 deletions scripts/stylelint-staged.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh
#!/bin/bash

executable=node_modules/.bin/staged-files
executable=$(npm bin)/staged-files
linter_name="stylelint"
linter_path=./node_modules/.bin/stylelint
linter_path=$(npm bin)/stylelint
lint_extensions="**/*.@(css|scss|less|styl)"

if [[ -e "${linter_path}" ]]; then
if [[ -f "${linter_path}" ]]; then
echo "Running ${linter_name} on git staged files: ${lint_extensions}"
${executable} "${lint_extensions}" -- ${linter_path}
else
Expand Down

0 comments on commit 6ae2d98

Please sign in to comment.