Embedded Resources
This commit is contained in:
@ -18,7 +18,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
FILE_TEMPLATE = """// IAEngine: 2D Game Engine by IA
|
||||
FILE_CONTENT_PREFIX = """// IAEngine: 2D Game Engine by IA
|
||||
// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
@ -40,18 +40,17 @@ FILE_TEMPLATE = """// IAEngine: 2D Game Engine by IA
|
||||
|
||||
namespace ia::iae
|
||||
{
|
||||
|
||||
}
|
||||
"""
|
||||
FILE_CONTENT_SUFFIX = "\n}"
|
||||
|
||||
def on_invalid_args():
|
||||
print(f"\033[33mUsage: {sys.argv[0]} <ProjectName> <PRIVATE|PUBLIC> <FileName>\033[39m")
|
||||
exit(1)
|
||||
|
||||
def add_header_file(fileName: str, fileDirectory: str):
|
||||
def add_header_file(fileName: str, fileDirectory: str, content: str):
|
||||
print(f"\033[32mAdding Header File '{fileName}' to '{fileDirectory}'..\033[39m")
|
||||
with open(f"{fileDirectory}/{fileName}", 'w') as f:
|
||||
f.write(FILE_TEMPLATE)
|
||||
f.write(f"{FILE_CONTENT_PREFIX}{content}{FILE_CONTENT_SUFFIX}")
|
||||
|
||||
def main(args: list[str]):
|
||||
if (len(args) < 4) or ((args[2] != "PUBLIC") and (args[2] != "PRIVATE")):
|
||||
@ -62,6 +61,7 @@ def main(args: list[str]):
|
||||
fileDirectory = f"Src/{args[1]}/inc/{args[1]}"
|
||||
else:
|
||||
fileDirectory = f"Src/{args[1]}/imp/hpp"
|
||||
add_header_file(fileName, fileDirectory)
|
||||
add_header_file(fileName, fileDirectory, "")
|
||||
|
||||
main(sys.argv)
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
||||
|
||||
Reference in New Issue
Block a user