mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
Merge pull request #296 from lord63-forks/sort-index-json
Sort the index json file
This commit is contained in:
commit
c0bbae2fdc
2 changed files with 3 additions and 3 deletions
File diff suppressed because one or more lines are too long
|
@ -14,12 +14,12 @@ Dir["#{ENV["TLDRHOME"]}/pages/**/*.md"].each do |file|
|
||||||
commands[name] = {
|
commands[name] = {
|
||||||
name: name,
|
name: name,
|
||||||
platform: [platform]
|
platform: [platform]
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
commands[name][:platform] << platform
|
commands[name][:platform] << platform
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
commands = commands.map do |k,v| v end
|
commands = commands.sort.map do |k,v| v end
|
||||||
|
|
||||||
File.write("#{ENV["TLDRHOME"]}/pages/index.json", {commands: commands}.to_json)
|
File.write("#{ENV["TLDRHOME"]}/pages/index.json", {commands: commands}.to_json)
|
||||||
|
|
Loading…
Add table
Reference in a new issue