diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index 9045ef3..62de40c 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -4,7 +4,7 @@ if __name__ == "__main__": print(":: C bytebeat generator: compiler unit") from argparse import ArgumentParser -from os import environ, makedirs, name as os_name +from os import getcwd, environ, makedirs, name as os_name, rename from os.path import exists, join as path_join from shlex import join as command_line_join, split as command_line_split from shutil import which @@ -30,9 +30,10 @@ PATHS = { "include_directory": "include" } -# Add `.` directory before all paths for compilation +# Add current directory before all paths for compilation +CURRENT_DIRECTORY = getcwd() for key in ["src_dir", "bin_dir", "include_directory"]: - PATHS[key] = path_join(".", PATHS[key]) + PATHS[key] = path_join(CURRENT_DIRECTORY, PATHS[key]) # Resolve paths PATHS["template"] = path_join(PATHS["src_dir"], PATHS["template"])