aboutsummaryrefslogtreecommitdiff
path: root/tools/upgrade.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-18 17:55:29 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-18 17:56:15 -0700
commitbf67a610135c0803187cf6ed896638962f142d14 (patch)
treea0b126c954168282c8c69ea728d4abbae712ac33 /tools/upgrade.nom
parentacb86f78c3f79479ac3a73f0e5862f8f5d8f31f5 (diff)
Updating to version 2.4.4.3, with new syntax for multi-statement 'if'
and switch statements.
Diffstat (limited to 'tools/upgrade.nom')
-rw-r--r--tools/upgrade.nom25
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