From 6728587dfc6a5f4090f2673113ffedb2be924daf Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 20 Jul 2018 20:27:15 -0700 Subject: Auto-formatted and auto-upgraded everything! --- tools/autoformat.nom | 6 ++++-- tools/upgrade.nom | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/autoformat.nom b/tools/autoformat.nom index de25292..acabefb 100755 --- a/tools/autoformat.nom +++ b/tools/autoformat.nom @@ -1,6 +1,7 @@ -#!/usr/bin/env nomsu -V2.4.4.3 +#!/usr/bin/env nomsu -V2.5.4.3 use "core" use "lib/os.nom" + %args = (command line args) %inplace = (no) if (%args.1 is "-i"): @@ -13,5 +14,6 @@ for %path in %args: #!/usr/bin/env nomsu -V\(Nomsu version) \((parse (read file %filename) from %filename) as nomsu) - if %inplace: write %formatted to file %filename + if %inplace: + write %formatted to file %filename ..else: say %formatted \ No newline at end of file diff --git a/tools/upgrade.nom b/tools/upgrade.nom index 016e5b9..a505aaa 100755 --- a/tools/upgrade.nom +++ b/tools/upgrade.nom @@ -1,3 +1,4 @@ +#!/usr/bin/env nomsu -V2.5.4.3 #!/usr/bin/env Nomsu -V2.4.4.3 use "core" use "compatibility" @@ -8,25 +9,30 @@ 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) %uptree = (%tree upgraded) - %text = "#!/usr/bin/env nomsu -V\(Nomsu version)\n\(%uptree as nomsu)" + %text = ".." + #!/usr/bin/env nomsu -V\(Nomsu version) + \(%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 - + + else: say %text \ No newline at end of file -- cgit v1.2.3