From 8ca82251220db2e6b61f36c200ed312c387ba237 Mon Sep 17 00:00:00 2001 From: paprykdev <58005447+paprykdev@users.noreply.github.com> Date: Fri, 15 Nov 2024 23:44:59 +0100 Subject: [PATCH] refactor: clean up get_path function and remove unnecessary print statement --- scripts/get_path.py | 5 ++--- scripts/run_with_no_docker.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/get_path.py b/scripts/get_path.py index 0624574..ee95f51 100644 --- a/scripts/get_path.py +++ b/scripts/get_path.py @@ -7,8 +7,6 @@ def get_path(): splitted = pwd.split("/") splitted[-1] = splitted[-1].replace("\n", "") - print(splitted[: splitted.index("webscraper") + 1]) - if splitted.count("webscraper") > 1 and "webscraper" in splitted: for i in range(len(splitted) - 1, -1, -1): potential_path = "/".join(splitted[: i + 1]) @@ -19,7 +17,8 @@ def get_path(): else: return "This is not a valid webscraper project." else: - return "/".join(splitted[: splitted.index("webscraper") + 1]) + path = "/".join(splitted[: splitted.index("webscraper") + 1]) + return path def run_main(): diff --git a/scripts/run_with_no_docker.py b/scripts/run_with_no_docker.py index 981a87c..ad7ee2b 100644 --- a/scripts/run_with_no_docker.py +++ b/scripts/run_with_no_docker.py @@ -1,5 +1,4 @@ import subprocess -import os from run_command import run_command from get_path import get_path