Skip to content

Commit 04709ee

Browse files
oops
1 parent 9422bc5 commit 04709ee

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tldrdict/update_pages.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#!/bin/bash
22
cd static
33

4-
index_json=$(curl -s 'https://github.com/tldr-pages/tldr/releases/latest/download/index.json')
5-
cat $index_json
6-
74
# json format for all commands with name, languages and platform
8-
cat $index_json | jq --compact-output '[.commands[] | {command: .name, info: .targets | group_by(.os)[] | {os: .[] | .os, languages: [.[] | .language]}}] | unique' > commands2.json
5+
curl -L 'https://github.com/tldr-pages/tldr/releases/latest/download/index.json | jq --compact-output '[.commands[] | {command: .name, info: .targets | group_by(.os)[] | {os: .[] | .os, languages: [.[] | .language]}}] | unique' > commands2.json
96
git clone https://github.com/tldr-pages/tldr
107
zip -r allpages.zip tldr/pages*
118
zip -r pages.zip tldr/pages # incase someone is still on the old version he should still get pages.zip
@@ -14,4 +11,4 @@ version=$(curl -s "https://api.github.com/repos/techno-disaster/tldr-flutter/com
1411
echo "{\"version\": \"$version\", \"lastUpdatedAt\": \"$(date +"%Y-%m-%d %T")\"}" > version.txt # deperacated, use versiom.json
1512
echo "{\"version\": \"$version\", \"lastUpdatedAt\": \"$(date +"%Y-%m-%d %T")\"}" > version.json
1613
# add a list of all supported languages to commands2.json
17-
cat $index_json | jq --compact-output '{supportedLanguages: [.commands[] | .language | .[]] | unique}' > temp.json && jq --compact-output --slurp add version.json temp.json | sponge version.json && rm temp.json
14+
curl -L 'https://github.com/tldr-pages/tldr/releases/latest/download/index.json | jq --compact-output '{supportedLanguages: [.commands[] | .language | .[]] | unique}' > temp.json && jq --compact-output --slurp add version.json temp.json | sponge version.json && rm temp.json

0 commit comments

Comments
 (0)