#!/bin/bash : ' @vendor Chorke Academia, Inc. @web https://cdn.chorke.org/docs/academia @version 1.0.00 @since 1.0.00 ' :<> \033[0;32m$SDK_DIR\033[0m\n" curl $SDK_URL --progress-bar> $SDK_DIR/$SDK_ZIP unzip -q $SDK_DIR/$SDK_ZIP -d $SDK_DIR rm -rf $SDK_DIR/$SDK_ZIP else printf "\nCURL \033[0;31mNot Found! \033[0m:(\n" fi fi } function create(){ if [ ! -d "$dir" ]&&[ "$(basename $(pwd))" != "$dir" ]&&[ "$(basename $(dirname $(pwd)))" != "$dir" ];then download sencha -sdk=$SDK_EXT generate app $app -classic $dir curl https://cdn.chorke.org/favicon.ico --progress-bar> $dir/favicon.ico fi } function install(){ if [ -f 'app.json' ]&&[ -f 'workspace.json' ]&&[ ! -d 'ext' ];then download sencha app install $SDK_EXT fi } function prepare(){ if [ -f 'app.json' ]&&[ -f 'workspace.json' ]&&[ ! -d 'ext' ];then download install fi if [ -f 'app.json' ]&&[ -f 'workspace.json' ]&&[ -d 'ext' ];then printf "\nSencha SDK \033[0;32mFound! \033[0m:)\n" else printf "\nSencha SDK \033[0;31mNot Found! \033[0m:(\n" fi } function debug(){ if [ -f 'app.json' ]&&[ -f 'workspace.json' ]&&[ -d 'ext' ];then sencha app build --clean --dev dev='build/development' if [ -d "$dev" ];then sencha web start fi else init fi } function init(){ if [ -x "$(command -v sencha)" ];then if [ ! -d "$dir" ]&&[ "$(basename $(pwd))" != "$dir" ]&&[ "$(basename $(dirname $(pwd)))" != "$dir" ];then create else printf "\nExtApp $app \033[0;32mFound! \033[0m:)\n" fi back="$(basename $(pwd))" if [ -d "$dir" ];then cd $dir prepare debug cd .. elif [ "$(basename $(pwd))" == "$dir" ];then prepare debug elif [ "$(basename $(dirname $(pwd)))" == "$dir" ];then cd .. prepare debug if [ -d "$back" ];then cd $back;fi else printf "\nExtApp $app \033[0;31mNot Found! \033[0m:(\n" fi else printf "\nSencha CMD \033[0;31mNot Found! \033[0m:(\n" fi } init