mirror of
https://github.com/logos-messaging/packages.git
synced 2026-01-19 22:43:08 +00:00
Merge branch 'fetch'
Conflicts: packages.json
This commit is contained in:
commit
b6069d4d62
@ -85,6 +85,7 @@
|
||||
"license": "zlib",
|
||||
"web": "https://github.com/Vladar4/libtcod-nim"
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
{
|
||||
"name": "nimepak",
|
||||
"url": "git://github.com/gradha/epak/",
|
||||
@ -99,6 +100,8 @@
|
||||
"license": "Allegro 4 Giftware",
|
||||
"web": "https://github.com/gradha/epak"
|
||||
},
|
||||
=======
|
||||
>>>>>>> fetch
|
||||
{
|
||||
"name": "nimgame",
|
||||
"url": "git://github.com/Vladar4/nimgame/",
|
||||
@ -2974,6 +2977,18 @@
|
||||
"license": "MIT",
|
||||
"web": "https://christine.website/projects/Vardene"
|
||||
},
|
||||
{
|
||||
"name": "quadtree",
|
||||
"url": "https://github.com/Nycto/QuadtreeNim",
|
||||
"method": "git",
|
||||
"tags": [
|
||||
"quadtree",
|
||||
"algorithm"
|
||||
],
|
||||
"description": "A Quadtree implementation",
|
||||
"license": "MIT",
|
||||
"web": "https://github.com/Nycto/QuadtreeNim"
|
||||
},
|
||||
{
|
||||
"name": "expat",
|
||||
"url": "https://github.com/nim-lang/expat",
|
||||
@ -3001,4 +3016,4 @@
|
||||
"license": "LGPL",
|
||||
"web": "https://github.com/Araq/sphinx"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
41
pretty_json.nim
Normal file
41
pretty_json.nim
Normal file
@ -0,0 +1,41 @@
|
||||
|
||||
import strutils, json, os
|
||||
|
||||
proc cleanupWhitespace(s: string): string =
|
||||
## Removes trailing whitespace and normalizes line endings to LF.
|
||||
result = newStringOfCap(s.len)
|
||||
var i = 0
|
||||
while i < s.len:
|
||||
if s[i] == ' ':
|
||||
var j = i+1
|
||||
while s[j] == ' ': inc j
|
||||
if s[j] == '\c':
|
||||
inc j
|
||||
if s[j] == '\L': inc j
|
||||
result.add '\L'
|
||||
i = j
|
||||
elif s[j] == '\L':
|
||||
result.add '\L'
|
||||
i = j+1
|
||||
else:
|
||||
result.add ' '
|
||||
inc i
|
||||
elif s[i] == '\c':
|
||||
inc i
|
||||
if s[i] == '\L': inc i
|
||||
result.add '\L'
|
||||
elif s[i] == '\L':
|
||||
result.add '\L'
|
||||
inc i
|
||||
else:
|
||||
result.add s[i]
|
||||
inc i
|
||||
if result[^1] != '\L':
|
||||
result.add '\L'
|
||||
|
||||
proc editJson() =
|
||||
var contents = parseFile("packages.json")
|
||||
doAssert contents.kind == JArray
|
||||
writeFile("packages.json", contents.pretty.cleanupWhitespace)
|
||||
|
||||
editJson()
|
||||
Loading…
x
Reference in New Issue
Block a user