Add require_app_clone
This commit is contained in:
parent
0d24a8e5cc
commit
5806e40c1c
24
abra
24
abra
@ -306,6 +306,18 @@ require_stack() {
|
||||
fi
|
||||
}
|
||||
|
||||
require_app_clone() {
|
||||
APP="$1"
|
||||
APP_DIR="$ABRA_DIR/apps/$APP"
|
||||
|
||||
if [ ! -d "$APP_DIR" ]; then
|
||||
warning "'$APP' not found, fetching via git.."
|
||||
if ! git clone "$GIT_URL/$APP.git" "$ABRA_DIR/apps/$APP"; then
|
||||
error "Could not retrieve '$APP', this app doesn't exist?"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# FIXME 3wc: update or remove
|
||||
if [ -z "$ABRA_ENV" ] && [ -f .envrc ] && type direnv > /dev/null 2>&1 && ! direnv status | grep -q 'Found RC allowed true'; then
|
||||
error "direnv is blocked, run direnv allow"
|
||||
@ -431,6 +443,8 @@ sub_app_new (){
|
||||
SERVER=$abra___server
|
||||
DOMAIN=$abra___domain
|
||||
|
||||
require_app_clone "$APP"
|
||||
|
||||
if [ -z "$SERVER" ]; then
|
||||
echo "Where would you like to put $APP?"
|
||||
|
||||
@ -450,16 +464,6 @@ sub_app_new (){
|
||||
|
||||
APP_DIR="$ABRA_DIR/apps/$APP"
|
||||
|
||||
if [ ! -d "$APP_DIR" ]; then
|
||||
# FIXME 3wc: move to require_app_clone or something
|
||||
warning "'$APP' not found, fetching via git.."
|
||||
|
||||
if ! git clone "$GIT_URL/$APP.git" "$ABRA_DIR/apps/$APP"; then
|
||||
error "Could not retrieve '$APP', this app doesn't exist?"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ -z "$DOMAIN" ]; then
|
||||
read -rp "Domain name: " DOMAIN
|
||||
fi
|
||||
|
Reference in New Issue
Block a user