diff --git a/frontrunners/apex-to-file.sh b/frontrunners/apex-to-file.sh new file mode 100644 index 0000000..894b357 --- /dev/null +++ b/frontrunners/apex-to-file.sh @@ -0,0 +1,3 @@ +# to be called from top level dir of project +node_modules/apex-source-control/scripts/check_conf_file.sh +node_modules/apex-source-control/scripts/apexupdate.sh diff --git a/frontrunners/file-to-apex.sh b/frontrunners/file-to-apex.sh new file mode 100644 index 0000000..dd9cedf --- /dev/null +++ b/frontrunners/file-to-apex.sh @@ -0,0 +1,5 @@ +# designed to be called from top level project dir +node_modules/apex-source-control/scripts/check_conf_file.sh +source config/apexupdate.conf +cd apex/ +sqlplus $username/$password@$database_connection @../node_modules/apex-source-control/scripts/install_apex.sql $apexappid $workspace_name $parsing_schema diff --git a/frontrunners/generate-app-id.sh b/frontrunners/generate-app-id.sh new file mode 100644 index 0000000..8f30177 --- /dev/null +++ b/frontrunners/generate-app-id.sh @@ -0,0 +1,4 @@ +# designed to be called from top level project dir +node_modules/apex-source-control/scripts/check_conf_file.sh +source config/apexupdate.conf +sqlplus $username/$password@$database_connection @node_modules/apex-source-control/scripts/generate_new_app_id.sql diff --git a/frontrunners/read-conf-file.sh b/frontrunners/read-conf-file.sh new file mode 100644 index 0000000..d65a52e --- /dev/null +++ b/frontrunners/read-conf-file.sh @@ -0,0 +1,18 @@ +# designed to be called from to level project dir + +if [ ! -h ./config/apexupdate.conf ]; then + echo "Missing symbolic link: $PWD/config/apexupdate.conf" + echo "Please use the command 'npm run switch-conf-file' to create the symbolic link ./config/apexupdate.conf to your config file" + echo "If you don't have a config file set up you can create one using 'npm run new-config-file'" + exit 1 +fi + +echo "The config file currently being used is: " +readlink ./config/apexupdate.conf + +echo + +echo "The config file looks like this: " +cat ./config/apexupdate.conf + +echo "If any of the data looks wrong you can simply edit the file yourself at ./config/$(readlink ./config/apexupdate.conf)" diff --git a/frontrunners/uninstall-apex.sh b/frontrunners/uninstall-apex.sh new file mode 100644 index 0000000..301d76b --- /dev/null +++ b/frontrunners/uninstall-apex.sh @@ -0,0 +1,4 @@ +# designed to be called from top level project dir +node_modules/apex-source-control/scripts/check_conf_file.sh +source config/apexupdate.conf +sqlplus $username/$password@$database_connection @node_modules/apex-source-control/scripts/uninstall_apex.sql $apexappid $workspace_name $parsing_schema diff --git a/package.json b/package.json index 0bea582..8d106b3 100644 --- a/package.json +++ b/package.json @@ -4,20 +4,24 @@ "description": "Scripts for bringing Oracle Application Express apps into source control", "main": "index.js", "bin" : { - "apex-update" : "scripts/apexupdate.sh", - "check-conf-file" : "scripts/check_conf_file.sh", "new-conf-file" : "scripts/make-new-config-file.sh", - "switch-conf-file" : "scripts/switch-config-file.sh" + "switch-conf-file" : "scripts/switch-config-file.sh", + "apex-to-file" : "frontrunners/apex-to-file.sh", + "file-to-apex" : "frontrunners/file-to-apex.sh", + "read-conf-file" : "frontrunners/read-conf-file.sh", + "generate-app-id" : "frontrunners/generate-app-id.sh", + "uninstall-apex" : "frontrunners/uninstall-apex.sh" }, "scripts": { "test": "echo teammates all left before they had to buy a round", "env" : "env", - "apex-to-file" : "check-conf-file && apex-update", - "file-to-apex" : "check-conf-file && source config/apexupdate.conf && cd non-apex/install && sqlplus $username/$password@$database_connection @install_apex.sql $apexappid $workspace_name $parsing_schema", + "apex-to-file" : "apex-to-file", + "file-to-apex" : "file-to-apex", "new-conf-file" : "new-conf-file", "switch-conf-file" : "switch-conf-file", - "which-conf-file" : "readlink ./config/apexupdate.conf", - "generate-new-app-id" : "check-conf-file && cd non-apex/install && sqlplus $username/$password@$database_connection @generate_new_app_id.sql" + "read-conf-file" : "read-conf-file", + "generate-new-app-id" : "generate-app-id", + "uninstall-apex" : "uninstall-apex" }, "repository": { "type": "git", diff --git a/scripts/generate_new_app_id.sql b/scripts/generate_new_app_id.sql index 197f0d8..bf1db32 100644 --- a/scripts/generate_new_app_id.sql +++ b/scripts/generate_new_app_id.sql @@ -3,7 +3,6 @@ set serveroutput on set feedback off begin apex_application_install.generate_application_id; - dbms_output.put_Line("Your new apex app id is..."); --This line should be commented out if you want to use spooling dbms_output.put_Line(apex_application_install.get_application_id); end; /