refactor: clean up get_path function and remove unnecessary print statement
Some checks are pending
Docker Image CI / build (push) Waiting to run
Some checks are pending
Docker Image CI / build (push) Waiting to run
This commit is contained in:
parent
ba9e42b9c6
commit
8ca8225122
@ -7,8 +7,6 @@ def get_path():
|
|||||||
splitted = pwd.split("/")
|
splitted = pwd.split("/")
|
||||||
splitted[-1] = splitted[-1].replace("\n", "")
|
splitted[-1] = splitted[-1].replace("\n", "")
|
||||||
|
|
||||||
print(splitted[: splitted.index("webscraper") + 1])
|
|
||||||
|
|
||||||
if splitted.count("webscraper") > 1 and "webscraper" in splitted:
|
if splitted.count("webscraper") > 1 and "webscraper" in splitted:
|
||||||
for i in range(len(splitted) - 1, -1, -1):
|
for i in range(len(splitted) - 1, -1, -1):
|
||||||
potential_path = "/".join(splitted[: i + 1])
|
potential_path = "/".join(splitted[: i + 1])
|
||||||
@ -19,7 +17,8 @@ def get_path():
|
|||||||
else:
|
else:
|
||||||
return "This is not a valid webscraper project."
|
return "This is not a valid webscraper project."
|
||||||
else:
|
else:
|
||||||
return "/".join(splitted[: splitted.index("webscraper") + 1])
|
path = "/".join(splitted[: splitted.index("webscraper") + 1])
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
def run_main():
|
def run_main():
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import os
|
|
||||||
from run_command import run_command
|
from run_command import run_command
|
||||||
from get_path import get_path
|
from get_path import get_path
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user