diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-12-30 19:04:34 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-12-30 19:04:45 -0800 |
| commit | 8a3c32408733a2f5e14f8a2dbafa3f980b2f73a1 (patch) | |
| tree | 68f1e8a8b956c33ed24cc7a6a369fd97b8849321 /tools/upgrade.nom | |
| parent | 359152da1772ce501609edd8f84b4985ed3e42f2 (diff) | |
Update to new syntax.
Diffstat (limited to 'tools/upgrade.nom')
| -rwxr-xr-x | tools/upgrade.nom | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/upgrade.nom b/tools/upgrade.nom index 96a1312..f335dc0 100755 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V5.12.12.8 +#!/usr/bin/env nomsu -V6.12.12.8 # Tool to automatically update code from old versions of Nomsu. Usage: nomsu tools/upgrade.nom [-i] file1 file2 directory1 ... @@ -19,13 +19,15 @@ for $filename in $(COMMAND LINE ARGS).extras: $file = (read file $filename) unless $file: barf "File does not exist: \$filename" - $leading_indent = ($file|matching "[\n]*([ ]*)") + $leading_indent = ($file, matching "[\n]*([ ]*)") $code = (NomsuCode from (Source $filename 1 (size of $file)) $file) $tree = ($code parsed $start_version) - $uptree = (..) - $tree upgraded from ($start_version or ($tree.version or (Nomsu version))) to \ + $uptree = + $tree upgraded from ($start_version or ($tree.version or (Nomsu version))) to ..$version - $text = "\$leading_indent\((($uptree as nomsu)|text)|with "\n" -> "\n\$leading_indent")" + + $text = "\$leading_indent\($uptree as nomsu, text, with "\n" -> "\n\$leading_indent")" + when: $inplace: say "Upgraded \$filename" |
