Codebase list poshc2 / 06a953b resources / scripts / fpc
06a953b

Tree @06a953b (Download .tar.gz)

fpc @06a953braw · history · blame

#!/bin/bash

# trap ctrl-c and call ctrl_c()
trap ctrl_c INT

function ctrl_c() {
    popd > /dev/null
    exit
}

source /usr/local/bin/_posh-common
get_posh_dir
get_posh_project_dir

DATABASE_TYPE=`cat $POSH_PROJECT_DIR/config.yml | grep "DatabaseType: " | cut -d "\"" -f 2`
DATABASE_STRING=`cat $POSH_PROJECT_DIR/config.yml | grep "PostgresConnectionString: " | cut -d "\"" -f 2`

pushd "$POSH_DIR" >/dev/null

if [ "$?" -eq "0" ]; then
    python3 -m pipenv run python3 "resources/scripts/fpc.py" -p "$POSH_PROJECT_DIR" -d "$DATABASE_TYPE" -pg "$DATABASE_STRING" $@
    popd > /dev/null
fi