diff options
Diffstat (limited to 'tools/upgrade.nom')
| -rw-r--r-- | tools/upgrade.nom | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tools/upgrade.nom b/tools/upgrade.nom index 14f7ee0..8f478ac 100644 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env Nomsu -V2.3.4.3 +#!/usr/bin/env Nomsu -V2.4.4.3 use "core" use "compatibility" use "lib/os.nom" @@ -8,14 +8,25 @@ use "lib/os.nom" if (%args.1 is "-i"): %inplace = (yes) remove index 1 from %args +if (%args.1 is "-t"): + use "lib/consolecolor.nom" + %test = (yes) + remove index 1 from %args for %path in %args: if (%path is "-i"): %inplace = (yes) for file %filename in %path: %tree = (parse (read file %filename) from %filename) - %tree = (%tree upgraded from %tree.version to (Nomsu version)) - %text = "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%tree as nomsu)" - if %inplace: - write %text to file %filename - ..else: - say %text + %uptree = (%tree upgraded from %tree.version to (Nomsu version)) + %text = "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%uptree as nomsu)" + if: + %inplace: + say "Upgraded \%filename" + write %text to file %filename + %test: + if (%uptree == %tree): + say (dim "\%filename will not be changed") + ..else: + say (bright "\%filename will be changed") + else: + say %text |
