1
0

b/c...py: use os.getcwd() instead of .

This commit is contained in:
Intel A80486DX2-66 2024-08-26 23:26:59 +03:00
parent 23801c4eaa
commit 0b0a6a4e0b
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B

View File

@ -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"])