From 4bd86a8880c18db24be1dbb0c944e196464e05b7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 14 Sep 2024 11:36:14 +0200 Subject: [PATCH] shell/step --- spcd/shell.py | 5 +++++ spcd/util.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/spcd/shell.py b/spcd/shell.py index f9f9b33..f0c7f8c 100644 --- a/spcd/shell.py +++ b/spcd/shell.py @@ -3,3 +3,8 @@ import importlib env = importlib.import_module("env") + +try: + step = int(env.SPCD_STEP) +except AttributeError: + step = 1 diff --git a/spcd/util.py b/spcd/util.py index a77691a..76cb0f0 100644 --- a/spcd/util.py +++ b/spcd/util.py @@ -7,7 +7,7 @@ from urllib.parse import urlparse, urlunparse from rwx import fs from rwx.log import stream as log -from spcd.shell import env +from spcd import env, shell def add_url_path(url: str, extra_path: str) -> str: @@ -57,7 +57,7 @@ def split() -> None: def step(text: str) -> None: """Increment the step number of the current build process.""" - env.SPCD_STEP += 1 + shell.step += 1 log.info(env.SPCD_DOWN) - log.info(f"{env.SPCD_VERT} {env.SPCD_STEP} {text}") + log.info(f"{env.SPCD_VERT} {shell.step} {text}") log.info(env.SPCD___UP)