Skip to content

Instantly share code, notes, and snippets.

View danielmcq's full-sized avatar

Daniel McQuiston danielmcq

View GitHub Profile
@danielmcq
danielmcq / eslint.sh
Created August 28, 2018 20:44 — forked from namnm/eslint.sh
Do eslint only changed files
# The regexp without escapse is ^[^D]{2}.*((.js)|/)$ with:
# [^D]{2} means that's not a deleted file from git output
# .* is the file name
# ((.js)|/) means it's end with .js extension, or a slash (directory)
# To use in package.json, we need to double the escapse: ^[^D]\\{2\\}.*\\(\\(\\.js\\)\\|/\\)$ pretty neat huh?
git status --porcelain | grep '^[^D]\{2\}.*\(\(\.js\)\|/\)$' | cut -c 4- | xargs eslint
@danielmcq
danielmcq / remove-tags.sh
Last active December 8, 2017 16:30 — forked from housser/remove-tags.sh
Remove Git tags based on regular expression, and remove from remote
#!/bin/bash
for i in $( git tag | grep ^tag_name_pattern ); do
#echo item: $i
git tag -d $i
#git push origin :refs/tags/$i
git push --delete origin $i
done
# or on one line