#!/usr/bin/env bash
if [ "$1" == "-login" ]; then
  npm login --registry https://registry.npmjs.org
fi

npm publish

if [ $? -eq 0 ]; then
  echo "Devmentor-tools has been published to NPM successfully"
  echo "https://www.npmjs.com/package/dm-tools"
else
  echo "ERROR: Something went wrong"
fi
