diff --git a/script/open_terminal_code_generator.sh b/script/open_terminal_code_generator.sh index c62dd6e..257934d 100755 --- a/script/open_terminal_code_generator.sh +++ b/script/open_terminal_code_generator.sh @@ -2,6 +2,7 @@ # Open a new gnome-terminal with different path on new tab working_path=$(readlink -f .) paths=( + "${working_path}/" "${working_path}/" "${working_path}/addons/ERPLibre_erplibre_addons" "${working_path}/addons/TechnoLibre_odoo-code-generator" @@ -11,6 +12,7 @@ paths=( ) first_iteration=true +second_iteration=true if [[ "${OSTYPE}" == "linux-gnu" ]]; then cmd_before="cd " cmd_after_first=";gnome-terminal --tab -- bash -c 'source ./.venv/bin/activate;git status;bash';" @@ -20,6 +22,9 @@ if [[ "${OSTYPE}" == "linux-gnu" ]]; then if $first_iteration; then LONGCMD+="${cmd_before}${t}${cmd_after_first}" first_iteration=false + elif $second_iteration; then + LONGCMD+="${cmd_before}${t}${cmd_after_first}" + second_iteration=false else LONGCMD+="${cmd_before}${t}${cmd_after}" fi @@ -36,6 +41,9 @@ elif [[ "${OSTYPE}" == "darwin"* ]]; then if $first_iteration; then osascript_command+=" -e 'tell application \"System Events\" to keystroke \"t\" using {command down}' -e 'delay 0.1' -e 'do script \"cd ${t}; source ./.venv/bin/activate; git status\" in front window'" first_iteration=false + elif $second_iteration; then + osascript_command+=" -e 'tell application \"System Events\" to keystroke \"t\" using {command down}' -e 'delay 0.1' -e 'do script \"cd ${t}; source ./.venv/bin/activate; git status\" in front window'" + second_iteration=false else osascript_command+=" -e 'tell application \"System Events\" to keystroke \"t\" using {command down}' -e 'delay 0.1' -e 'do script \"cd ${t}; git status\" in front window'" fi