#!/bin/sh

#BRANDS="columbia demo gore mesh01 nike sales"
BRANDS="gore"
BRANCH=`git branch 2> /dev/null | sed -n '/^\*/s/^\* \(.*\)/\1/p'`
TAG_ARG=

echo Branch: $BRANCH

if [ $BRANCH != 'master' ]; then
    TAG_ARG="--tag $BRANCH"
fi
echo Tag: $TAG_ARG

# Increment the versions
#for i in $BRANDS; do
#    pushd $i; npm version patch; popd
#done

# Commit in git repo
#git add $BRANDS
#git commit -m "Bump versions"
#git push origin $BRANCH

# Publish in npm repo
for i in $BRANDS; do
    echo pushd $i; git clean -xfd; npm publish $TAG_ARG; popd
done

