From bfd7826492c51c06370abb64f51e11f9900ca906 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 16 May 2021 17:53:27 -0400 Subject: [PATCH] [ADD] script open terminal to improve code generator development --- Makefile | 7 +++++++ script/open_terminal_code_generator.sh | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 script/open_terminal_code_generator.sh diff --git a/Makefile b/Makefile index 9d16ced..a44beac 100644 --- a/Makefile +++ b/Makefile @@ -192,6 +192,13 @@ test_code_generator_template: db_restore_erplibre_base_db_template addons_instal .PHONY: test_code_generator_demo test_code_generator_demo: db_restore_erplibre_base_db_template addons_install_all_generated_demo clean_code_generator_template +############## +# terminal # +############## +.PHONY: open_terminal +open_terminal: + ./script/open_terminal_code_generator.sh + ############ # format # ############ diff --git a/script/open_terminal_code_generator.sh b/script/open_terminal_code_generator.sh new file mode 100755 index 0000000..45a80f0 --- /dev/null +++ b/script/open_terminal_code_generator.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# Open a new gnome-terminal with different path on new tab +working_path=`readlink -f .` +paths=( +"${working_path}/" +"${working_path}/addons/TechnoLibre_odoo-code-generator" +"${working_path}/addons/TechnoLibre_odoo-code-generator-template" + +) +cmd_before="cd " +# when change directory, open a new tab with command to execute +cmd_after=";gnome-terminal --tab -- bash -c 'git status;bash';" +#cmd_after=";gnome-terminal --tab;" + +LONGCMD="" +for t in ${paths[@]}; do + LONGCMD+=${cmd_before}${t}${cmd_after} +done + +#echo $LONGCMD + +# Open all terminal from paths list +#echo "gnome-terminal --window -- bash -c \"${LONGCMD}\"" +gnome-terminal --window -- bash -c "${LONGCMD}"