From 422d8dc8a6ef472636e4210004d361ff906e4fbe Mon Sep 17 00:00:00 2001 From: James Patrick Date: Tue, 24 May 2022 18:56:59 +0000 Subject: [PATCH] Relocated path helpers to be accessible earlier --- zsh/environment/host/devF/zshenv | 14 ++++++++++++++ zsh/environment/host/devF/zshrc | 16 +--------------- 2 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 zsh/environment/host/devF/zshenv diff --git a/zsh/environment/host/devF/zshenv b/zsh/environment/host/devF/zshenv new file mode 100644 index 0000000..c52ba78 --- /dev/null +++ b/zsh/environment/host/devF/zshenv @@ -0,0 +1,14 @@ + +export build_dir="/opt/build" +export apps_dir="/mount/data0/apps" + +for build_path in $build_dir/* ; do + if [[ $build_path =~ "shared" ]]; then + continue; + fi + # get the env name from the full path. + local env_name=$(basename $build_path ) + eval "export ${env_name}_build=${build_path}" + eval "export ${env_name}_app=${apps_dir}/${env_name}" + eval "export ${env_name}_logs=${apps_dir}/${env_name}/logs" +done diff --git a/zsh/environment/host/devF/zshrc b/zsh/environment/host/devF/zshrc index ba7e04a..fd0a7a4 100644 --- a/zsh/environment/host/devF/zshrc +++ b/zsh/environment/host/devF/zshrc @@ -1,6 +1,6 @@ ##### Aliases -# Database Connection db_envs=(cadev ildev indev ladev txdev utdev mddev) +# Database Connection for env in $db_envs ; do eval "alias psql_$env='psql -d $env -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U ${env}_owner'" if (( $+commands[pgcli] )); then @@ -12,17 +12,3 @@ done alias psql_l="psql -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U greenfiling -l" # Sign-In as limited super user. alias psql_root="psql -d postgres -h dev.cpmixkhfrend.us-east-1.rds.amazonaws.com -p 5432 -U greenfiling" - -##### Conveniences -############################################################################################################# - -export build_dir="/opt/build" -export apps_dir="/mount/data0/apps" - -for build_path in $build_dir/^shared ; do - # get the env name from the full path. - local env_name=$(basename $build_path ) - eval "export ${env_name}_build=${build_path}" - eval "export ${env_name}_app=${apps_dir}/${env_name}" - eval "export ${env_name}_logs=${apps_dir}/${env_name}/logs" -done