alias cdk='cdkdtct;eval $(echo "${NVM_INC}/bin/cdk" | rev | cut -d '/' -f 1-2,5-99 | rev)' alias cdki='npm install' alias cdkv='cdk synth' alias cdkp='cdk deploy --no-execute' alias cdka='cdk deploy' alias cdkw='cdk watch' function ch(){ local opts=$(cat << EOF cdk :: . ______________ cdk_boot_def :: cdk bootstrap cdk_boot_imprt :: cdk bootstrap aws://%s/%s cdk_boot_nodef :x: $(printf "cdk bootstrap --qualifier '%s'" "${1}" ) cdk_diff :: NO_COLOR=1 cdk diff 2>&1 | tee cdk_diff.txt cdk_diff_sglstg :: NO_COLOR=1 cdk diff '%s' 2>&1 | tee cdk_diff.txt cdk_diff_sglstk :: NO_COLOR=1 cdk diff '%s' 2>&1 | tee cdk_diff.txt cdk_init :: cdk init app --language typescript cdk_synth :: NO_COLOR=1 cdk synth 2>&1 | tee cdk_synth.txt cdk_synth_sgl :: NO_COLOR=1 cdk synth '%s' 2>&1 | tee cdk_synth.txt chk :: . ______________ chk_mstr :: find . -type f -regex '.*\.ts$' -path '*/head*' -not -path '*/node_modules*' -not -path '*/.git*' | sort -u | xargs -rI{} grep -EHn "^" '{}' >masterAllCnt.txt chk_run_hddn :: cat '%s' | grep -E 'Naming convention violation|Expected format:' code :: . ______________ code_cdktxt :: code '%s' crs :: . ______________ crs_link :: $(printf "rm -f ~/dev/cursor/* ; ln -s '%s' '%s/dev/cursor/cdk_stuff_%s'" "${PWD}" "${HOME}" "$(pwd | sed -E 's|(.*)/head/(.*)|\1|g' | rev | cut -d '/' -f 1 | rev)") npm :: . ______________ npm_inst :: npm install npm_inst :: npx tsc git :: . ______________ git_chkout_brnch :: find -type d | grep -E 'head$|master$' | xargs -rI{} bash -c "cd '{}' ; git checkout '%s'" EOF ) local cdk_stages=$(cat << EOF *-DEV-CLD EOF ) local git_branches=$(cat << EOF dev EOF ) local selOpt=$(echo "${opts}" | grep -vE '^##' | nl -i1 -n'rz' -v0 -w3 | sort -ru | fzf) if [ "${selOpt}" == "" ]; then echo ">>>>>>> nothing selected, cancel ..." return fi selOpt=$(echo "${selOpt}" | tr '\t' ' ' | tr -s ' ') prfx=$( echo "${selOpt}" | cut -d ' ' -f 2 ) mode=$( echo "${selOpt}" | cut -d ' ' -f 3 ) selOpt=$( echo "${selOpt}" | cut -d ' ' -f 4-999 ) ## echo "${prfx}" ## echo "${mode}" ## echo "${selOpt}" case "${prfx}" in cdk_boot_imprt) selOpt=$(printf "${selOpt}" "$(aws sts get-caller-identity --query "Account" --output text)" "$(aws configure get region)") ;; cdk_diff_sglstk) selOpt=$(printf "${selOpt}" "$(printf "$(cdk ls)" | grep -vE '^Now using' | fzf)") ;; cdk_diff_sglstg|cdk_synth_sgl) selOpt=$(printf "${selOpt}" "$(echo "${cdk_stages}" | grep -vE '^##' | sort -ru | fzf)") ;; chk_run_hddn|code_cdktxt) selOpt=$(printf "${selOpt}" "$(ls -1 | grep -E 'cdk.*\.txt$' | fzf)") ;; git_chkout_brnch) selOpt=$(printf "${selOpt}" "$(echo "${git_branches}" | grep -vE '^##' | sort -ru | fzf)") ;; *) ;; esac echo ">>>>>>> ${selOpt}" history -s "${selOpt}" if [[ "$mode" == ":x:" ]]; then history -s "ch '$@'"; else history -s "ch"; fi eval "${selOpt}" } function cdkdtct(){ if [ 1 == 0 ] ; then echo 'huhu' ; ## ## -- DUMMY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - elif [ $(echo "${PWD}" | rev | cut -d '/' -f 2 | rev) == "cdk-vpc-demo" ] ; then nvm use 24.15 ; export AWS_PROFILE=122217416383_AAPowerAdministrator ; elif [ $(echo "${PWD}" | rev | cut -d '/' -f 3 | rev) == "aws-infra-Gambit" ] ; then nvm use 24.15 ; export AWS_PROFILE=304321522464_PowerUserAccess ; fi }