legendary-doc-site/script/update

27 lines
695 B
Bash
Executable file

#!/bin/sh
set -x
set -e
FULL_PATH=$(realpath $0)
DIR_PATH=$(dirname $FULL_PATH)
$DIR_PATH/bootstrap
ORIGIN=`git remote get-url origin || echo ''`
FRAMEWORK=`git remote get-url framework || echo ''`
if [ "$ORIGIN" == 'git@gitlab.com:mythic-insight/legendary.git' ] && [ "$FRAMEWORK" != 'git@gitlab.com:mythic-insight/legendary.git' ]; then
echo "Removing Legendary repo as 'origin' remote"
git remote remove origin
fi;
if [ "$FRAMEWORK" != 'git@gitlab.com:mythic-insight/legendary.git' ]; then
echo "Setting Legendary repo as 'framework' remote"
git remote add framework git@gitlab.com:mythic-insight/legendary.git
fi;
mix deps.get
mix npm.install
mix ecto.create
mix ecto.migrate