From 0b0a6a4e0ba02abd1fb3d697466757fbd58db4ee Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Mon, 26 Aug 2024 23:26:59 +0300 Subject: [PATCH] b/c...py: use `os.getcwd()` instead of `.` --- bytebeat_compiler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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"])