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

15
commands/cmd_nano.py Normal file
View File

@@ -0,0 +1,15 @@
import os, subprocess
from colorama import Fore
class NanoCommand:
def __init__(self, base_dir, filename):
if not filename.endswith(".m5r"):
filename += ".m5r"
self.path = os.path.join(base_dir, filename)
def run(self):
editor = os.getenv("EDITOR", "notepad")
if not os.path.exists(self.path):
print(Fore.YELLOW + f"Note: {self.path} does not exist, creating it.")
open(self.path, "w").close()
subprocess.call([editor, self.path])