Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Update abstra-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
abstra-bot committed Apr 19, 2023
1 parent da46514 commit b545e0b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions abstra_cli/resources/dashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def play(*args, **kwargs):
@staticmethod
def map_deploy_data(abstra_json_path: str, workspace_json_data: dict):
abstra_json_dir = os.path.dirname(abstra_json_path)
base_path = utils.remove_suffix(
workspace_json_data["workspace"].get("base_path", ""), "/"
)

dash_files = glob(
os.path.join(abstra_json_dir, "**", "*.abstradash.json"),
recursive=True,
Expand All @@ -242,6 +246,9 @@ def map_deploy_data(abstra_json_path: str, workspace_json_data: dict):
route = os.path.relpath(
common_path, os.path.join(abstra_json_dir, ".")
).replace("\\", "/")

route = utils.remove_prefix(route, f"{base_path}/")

script_path = common_path + ".py"
dash_json_data = json.load(open(dash_file_path, "r"))
prop = {
Expand Down
6 changes: 6 additions & 0 deletions abstra_cli/utils/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ def remove_prefix(text, prefix):
return text


def remove_suffix(text, suffix):
if text.endswith(suffix):
return text[: -len(suffix)]
return text


def digits(n):
return len(str(n))

Expand Down

0 comments on commit b545e0b

Please sign in to comment.