Add files via upload

This commit is contained in:
m5rcel { Marcel }
2025-09-08 22:11:19 +02:00
committed by GitHub
parent af762526f5
commit 751062a706
21 changed files with 698 additions and 0 deletions

16
commands/cmd_new.py Normal file
View File

@@ -0,0 +1,16 @@
import os
from colorama import Fore
class NewCommand:
def __init__(self, base_dir, filename):
if not filename.endswith(".m5r"):
filename += ".m5r"
self.path = os.path.join(base_dir, filename)
def run(self):
if os.path.exists(self.path):
print(Fore.RED + f"Error: {self.path} already exists.")
return
with open(self.path, "w") as f:
f.write("// New m5r file\n")
print(Fore.GREEN + f"Created: {self.path}")