diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 23:08:13 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 23:08:24 -0700 |
| commit | ba639f2bd05f47e08c12198b7b20cd4cf371b25f (patch) | |
| tree | 656fcb15a27e642f891fba24046e01b4f139ab52 /tools | |
| parent | 854b2a652ff473c9d2eaa3222008d4baed36ae63 (diff) | |
Upgraded core code to latest Nomsu verison.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/upgrade.nom | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/upgrade.nom b/tools/upgrade.nom index e55d835..26b01bd 100644 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -1,10 +1,21 @@ +#!/usr/bin/env Nomsu -V 2.2.4.3 use "core" use "compatibility" use "lib/os.nom" -for %path in (=lua "arg"): +%args <- (command line args) +%inplace <- (no) +if (%args.1 is "-i"): + %inplace <- (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)) - say "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%tree as nomsu)" + %text <- "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%tree as nomsu)" + if %inplace: + write %text to file %filename + ..else: + say %text |
