Skip to content

Commit

Permalink
fix the script path
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed May 31, 2023
1 parent 09cb8b8 commit fd75498
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pygeoweaver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess
import webbrowser
from pygeoweaver.constants import GEOWEAVER_DEFAULT_ENDPOINT_URL
from pygeoweaver.utils import checkIPython, checkOS, download_geoweaver_jar, get_logger, get_root_dir
from pygeoweaver.utils import checkIPython, checkOS, download_geoweaver_jar, get_logger, get_module_absolute_path, get_root_dir

"""
This module provides function to start and stop Geoweaver server.
Expand All @@ -18,15 +18,15 @@ def start(force=False):
if checkOS() == 3:
raise RuntimeError("windows is not supported yet")
else:
result = subprocess.run(['./start.sh'], cwd=f"{get_root_dir()}/")
result = subprocess.run([f'{get_module_absolute_path()}/start.sh'], cwd=f"{get_root_dir()}/")



def stop():
if checkOS() == 3:
raise RuntimeError("Windows is not supported yet")
else:
result = subprocess.run(['./stop.sh'], cwd=f"{get_root_dir()}/", shell=True)
result = subprocess.run([f'{get_module_absolute_path()}/stop.sh'], cwd=f"{get_root_dir()}/", shell=True)


def show(geoweaver_url = GEOWEAVER_DEFAULT_ENDPOINT_URL):
Expand Down
4 changes: 4 additions & 0 deletions pygeoweaver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def get_root_dir():
head, tail = os.path.split(__file__)
return head

def get_module_absolute_path():
module_path = os.path.abspath(__file__)
return os.path.dirname(module_path)


def get_geoweaver_jar_path():
return f"{get_home_dir()}/geoweaver.jar"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pygeoweaver"
version = "0.6.6"
version = "0.6.7"
authors = [
{ name="Geoweaver team", email="[email protected]" },
]
Expand All @@ -22,7 +22,7 @@ classifiers = [

[tool.poetry]
name = "pygeoweaver"
version = "0.6.6"
version = "0.6.7"
description = "This is a wrapper package of the Geoweaver app."
authors = ["Geoweaver team <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit fd75498

Please sign in to comment.