diff --git a/apex-source-control b/apex-source-control index 64732e4..b859939 100755 --- a/apex-source-control +++ b/apex-source-control @@ -1,5 +1,40 @@ #!/bin/bash +function main { +case "${1}" in + 'test') + ./scripts/check_conf_file.sh + ;; + 'apex-to-file') + apex_to_file + ;; + 'file-to-apex') + file_to_apex + ;; + 'new-conf-file') + new_conf_file + ;; + 'switch-conf-file') + switch_conf_file + ;; + 'read-conf-file') + read_conf_file + ;; + 'generate-app-id') + generate_app_id + ;; + 'uninstall-apex') + uninstall_apex + ;; + get-connect-string|connect-string) + get_connect_string + ;; + *) + echo "apex-source-control: bad command" + ;; +esac +} + function die { echo $@ exit 1 @@ -9,8 +44,15 @@ function upcase { echo "$@" | tr '[a-z-]' '[A-Z_]' } -function run_sql_cmd { +function get_connect_string { + source ./config/asc.conf local connect_string="${username}/${password}@${database_connection}" + echo "${connect_string}" +} + + +function run_sql_cmd { + local connect_string="$(get_connect_string)" local sql_cmd if which sql > /dev/null; then echo Running PWD $PWD @@ -342,36 +384,5 @@ cat ./config/asc.conf echo "If any of the data looks wrong you can simply edit the file yourself at ./config/$(readlink ./config/asc.conf)" } -function main { -case "${1}" in - 'test') - ./scripts/check_conf_file.sh - ;; - 'apex-to-file') - apex_to_file - ;; - 'file-to-apex') - file_to_apex - ;; - 'new-conf-file') - new_conf_file - ;; - 'switch-conf-file') - switch_conf_file - ;; - 'read-conf-file') - read_conf_file - ;; - 'generate-app-id') - generate_app_id - ;; - 'uninstall-apex') - uninstall_apex - ;; - *) - echo "apex-source-control: bad command" - ;; -esac -} main "$@" diff --git a/package.json b/package.json index f344b08..1d0e8c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "apex-source-control", - "version": "1.3.4", + "version": "1.4.0", "description": "Scripts for bringing Oracle Application Express apps into source control", "bin": { "apex-source-control": "apex-source-control"