Show current GIT branch name
function git-name {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
#!/bin/bash | |
# ---------------------------------- | |
# | |
# pre-push hook running tests | |
# | |
git stash -q --keep-index | |
# NodeJS project | |
npm test |
#!/usr/bin/env bash | |
# Add or remove keywords here | |
FORBIDDEN="console\.(debug|info|log|warn)\(|alert\(|debugger" | |
# Add extensions to check here | |
FILES_PATTERN="\.(js|coffee)(\..+)?$" | |
LINE="" | |
VERBOSE=false | |
ERRORS_BUFFER="" |
# Using Bash | |
VERSION=$(npm version patch) | |
VERSION=$(echo $VERSION | cut -c 2-) | |
# Using NodeJS | |
PACKAGE_VERSION=$(node -p -e "require('./package.json').version") |
#!/bin/bash | |
# | |
# Check if there's some unstaged/uncommitted changes | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "[\033[1;31mPlease commit your changes before upgrading application version.\033[m"; | |
exit 1; | |
fi | |
# npm version (major|minor|patch|premajor|preminor|prepatch|prerelease) |
#!/bin/sh | |
# | |
# ----------------------------------------- | |
# | |
# | |
# Check if git directory exists | |
# if not exists will create and init a new local repository | |
if [ ! -d "$DIRECTORY" ]; then | |
git init |
tree -a -L 2 |