From 86872450eeabb46189f7d75cfb2c8d95c614b18f Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Sun, 4 Jun 2023 23:38:19 -0400 Subject: [PATCH 1/4] Update utils.py --- pygeoweaver/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pygeoweaver/utils.py b/pygeoweaver/utils.py index 29c660c..0933d72 100644 --- a/pygeoweaver/utils.py +++ b/pygeoweaver/utils.py @@ -28,11 +28,15 @@ def get_java_bin_from_which(): try: + print("Executing: ", f'{get_root_dir()}/java_bin.sh') + output = subprocess.check_output([f'{get_root_dir()}/java_bin.sh'], encoding='utf-8') java_bin_path = output.strip() - except subprocess.CalledProcessError: + except subprocess.CalledProcessError as e: + + print(f"Command execution failed: {e.output}") return None From 94c152247a125f67c19dff44c4e959416093cba8 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Sun, 4 Jun 2023 23:51:45 -0400 Subject: [PATCH 2/4] Update jdk_utils.py --- pygeoweaver/jdk_utils.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pygeoweaver/jdk_utils.py b/pygeoweaver/jdk_utils.py index fcf1c8f..a172ba2 100644 --- a/pygeoweaver/jdk_utils.py +++ b/pygeoweaver/jdk_utils.py @@ -113,12 +113,21 @@ def extract_zip_archive(archive_path, destination_dir): def set_jdk_env_vars(jdk_install_dir): print(f'Setting JDK environment variables...') + java_line = f'\nexport JAVA_HOME="{jdk_install_dir}"\n' + + check_java = False + with open(os.path.expanduser("~/.bashrc"), 'r') as file: + for line in file: + if line.strip() == java_line: + check_java = True + break + + if not check_java: + with open(os.path.expanduser("~/.bashrc"), "a") as bashrc: + bashrc.write() + bashrc.write(f'export PATH="$JAVA_HOME/bin:$PATH"\n') + print('JDK environment variables set.') - with open(os.path.expanduser("~/.bashrc"), "a") as bashrc: - bashrc.write(f'\nexport JAVA_HOME="{jdk_install_dir}"\n') - bashrc.write(f'export PATH="$JAVA_HOME/bin:$PATH"\n') - - print('JDK environment variables set.') subprocess.run(['bash', '-c', 'source ~/.bashrc']) From cf91bc5c30528d1610bc567bd4c9aeb6873d15c7 Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Sun, 4 Jun 2023 23:55:41 -0400 Subject: [PATCH 3/4] Update jdk_utils.py --- pygeoweaver/jdk_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygeoweaver/jdk_utils.py b/pygeoweaver/jdk_utils.py index a172ba2..a4f8c36 100644 --- a/pygeoweaver/jdk_utils.py +++ b/pygeoweaver/jdk_utils.py @@ -124,7 +124,7 @@ def set_jdk_env_vars(jdk_install_dir): if not check_java: with open(os.path.expanduser("~/.bashrc"), "a") as bashrc: - bashrc.write() + bashrc.write(f'\nexport JAVA_HOME="{jdk_install_dir}"\n') bashrc.write(f'export PATH="$JAVA_HOME/bin:$PATH"\n') print('JDK environment variables set.') From 497dba2a90888162b580a2e51aaff2ef1f4f6a1d Mon Sep 17 00:00:00 2001 From: Ziheng Sun Date: Mon, 5 Jun 2023 00:00:04 -0400 Subject: [PATCH 4/4] Update pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dd5f55e..9717659 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pygeoweaver" -version = "0.6.12" +version = "0.6.13" authors = [ { name="Geoweaver team", email="geoweaver.app@gmail.com" }, ] @@ -22,7 +22,7 @@ classifiers = [ [tool.poetry] name = "pygeoweaver" -version = "0.6.12" +version = "0.6.13" description = "This is a wrapper package of the Geoweaver app." authors = ["Geoweaver team "] readme = "README.md"