From d68912f5e59d251204a5ad8394059c6683e9dbc8 Mon Sep 17 00:00:00 2001 From: bleck9999 <55853712+bleck9999@users.noreply.github.com> Date: Tue, 27 Jul 2021 19:46:48 +0100 Subject: [PATCH] crab _min is gone crab (also stdlib updates) --- ts-minifier.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ts-minifier.py b/ts-minifier.py index b43baf0..b8a6208 100644 --- a/ts-minifier.py +++ b/ts-minifier.py @@ -1,6 +1,6 @@ # Copyright (c) 2021 bleck9999 # https://github.com/bleck9999/ts-minifier -# Version: 4fc47b37 +# Version: b9ea46f3 import argparse import re @@ -11,7 +11,8 @@ sub_funcs = {'while': "_h", 'print': "_p", 'println': "_l", 'mountsys': "_s", 'm 'mkdir': "_k", 'memory': "_m", 'ncatype': "_n", 'pause': "_w", 'color': "_a", 'menu': "__", 'emu': "_u", 'clear': "_x", 'timer': "_t", 'deldir': "_g", 'fsexists': "_f", 'delfile': "_z", "copydir": "c_", "movefile": "_v", "payload": "_j", "readfile": "_o", "writefile": "w_", "setpixels": "y_", "printpos": "p_", - "emmcread": "e_", "emmcwrite": "f_", "emummcread": "r_", "emummcwrite": "s_"} + "emmcread": "e_", "emmcwrite": "f_", "emummcread": "r_", "emummcwrite": "s_", "escapepath": "x_", + "combinepath": "a_"} replace_functions = False @@ -177,5 +178,8 @@ if __name__ == '__main__': with open(file, 'r') as f: r = minify(f.read()) file = file.split(sep='.')[0].split(sep='/')[-1] - f = open(f"{dest}/{file}_min.te", 'w') + if dest != '.': + f = open(f"{dest}/{file}.te", 'w') + else: + f = open(f"{dest}/{file}_min.te", 'w') f.write(r)