60 lines
2.1 KiB
Python
60 lines
2.1 KiB
Python
#!/bin/python3
|
|
|
|
# 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
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
import sys
|
|
|
|
FILE_TEMPLATE = """// 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
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
namespace ia::iae
|
|
{
|
|
|
|
}
|
|
"""
|
|
|
|
def on_invalid_args():
|
|
print(f"\033[33mUsage: {sys.argv[0]} <ProjectName> <FileName>\033[39m")
|
|
exit(1)
|
|
|
|
def add_source_file(fileName: str, fileDirectory: str):
|
|
print(f"\033[32mAdding Source File '{fileName}' to '{fileDirectory}'..\033[39m")
|
|
with open(f"{fileDirectory}/{fileName}", 'w') as f:
|
|
f.write(FILE_TEMPLATE)
|
|
|
|
def main(args: list[str]):
|
|
if len(args) < 3:
|
|
on_invalid_args()
|
|
fileName = f"{args[3]}.cpp"
|
|
fileDirectory = f"Src/{args[1]}/imp/cpp"
|
|
add_source_file(fileName, fileDirectory)
|
|
|
|
main(sys.argv)
|