Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to bin/bash since we are using a bash extension and use -f ins… #9

Merged
merged 1 commit into from
May 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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