patch for issue #1. Way to be the firstgit add --all

This commit is contained in:
ekultek 2017-09-21 10:14:42 -05:00
parent 909c817b6e
commit d0a0a8b9c5
2 changed files with 20 additions and 5 deletions

View file

@ -11,10 +11,15 @@ def check_if_run(file_check="{}/bin/executed.txt"):
"""
check if the application has been run before by reading the executed.txt file
"""
with open(file_check.format(os.getcwd())) as exc:
if "FALSE" in exc.read():
if os.path.isfile(file_check.format(os.getcwd())):
with open(file_check.format(os.getcwd())) as exc:
if "FALSE" in exc.read():
return True
return False
else:
with open(file_check.format(os.getcwd()), "a+") as exc:
exc.write("FALSE")
return True
return False
def untar_gecko(filename="{}/bin/geckodriver-v0.18.0-linux{}.tar.gz", verbose=False):
@ -76,9 +81,19 @@ def main(rewrite="{}/bin/executed.txt", verbose=False):
main method
"""
if check_if_run():
lib.settings.logger.info(lib.settings.set_color(
"seems this is your first time running the appication, "
"doing setup please wait..."
))
untar_gecko(verbose=verbose)
if ensure_placed(verbose=verbose):
with open(rewrite.format(os.getcwd()), "w") as rw:
rw.write("TRUE")
lib.settings.logger.info(lib.settings.set_color(
"done, continuing process..."
))
else:
pass
if verbose:
lib.settings.logger.debug(lib.settings.set_color(
"already ran, skipping...", level=10
))

View file

@ -17,7 +17,7 @@ import bin.unzip_gecko
# clone link
CLONE = "https://github.com/ekultek/zeus-scanner.git"
# current version <major.minor.commit.patch ID>
VERSION = "1.0.14.2e73"
VERSION = "1.0.15.c107c"
# colors to output depending on the version
VERSION_TYPE_COLORS = {"dev": 33, "stable": 92, "other": 30}
# version string formatting