Skip to content

Instantly share code, notes, and snippets.

@fujimura
Created November 23, 2016 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujimura/f7bcd2fdd734855410f2662f52031bd1 to your computer and use it in GitHub Desktop.
Save fujimura/f7bcd2fdd734855410f2662f52031bd1 to your computer and use it in GitHub Desktop.
#! /bin/bash
npm --version
npm install
$(npm bin)/eslint --version
$(npm bin)/eslint --fix $(git ls-files | grep -v vendor | grep "js[x]*$") || true
git diff --exit-code && exit 0
git add .
timestamp=`date +'%Y%m%d%H%M'`
commit_comment="eslint --fix $timestamp"
git commit -m "$commit_comment"
git checkout -b eslint-fix-$timestamp
branch_name=`git name-rev --name-only HEAD`
git push -u origin $branch_name
hub pull-request -m "$commit_comment" -h proper-inc:$branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment