1
1
#! /usr/bin/env bash
2
2
set +vx -o pipefail
3
3
[[ $- = * i* ]] && echo " Don't source this script!" && return 1
4
- version=' 0.46 '
4
+ version=' 0.47 '
5
5
# tldr-bash-client version 0.44
6
6
# Bash client for tldr: community driven man-by-example
7
7
# - forked from Ray Lee, https://github.com/raylee/tldr
8
8
# - modified and expanded by pepa65: https://gitlab.com/pepa65/tldr-bash-client
9
- # - binary download: http ://4e4.win/tldr
9
+ # - binary download: https ://4e4.win/tldr
10
10
# Requiring: coreutils, grep, unzip, curl/wget, less (optional)
11
11
12
12
# The 5 elements in TLDR markup that can be styled with these colors and
@@ -207,7 +207,7 @@ Config(){
207
207
trap ' cat <<<"$stdout"' EXIT ||
208
208
trap ' less -~RXQFP"Browse up/down, press Q to exit " <<<"$stdout"' EXIT
209
209
210
- ver=" tldr-bash-client version $version$XB ${URL} http ://gitlab.com/pepa65/tldr-bash-client$XURL "
210
+ ver=" tldr-bash-client version $version$XB ${URL} https ://gitlab.com/pepa65/tldr-bash-client$XURL "
211
211
212
212
# Select download method
213
213
! dl=" $( type -P curl) -sLfo" &&
@@ -216,7 +216,7 @@ Config(){
216
216
exit 3
217
217
218
218
repo_url=' https://raw.githubusercontent.com/tldr-pages/tldr/master'
219
- zip_url=' http ://tldr.sh/assets/tldr.zip'
219
+ zip_url=' https ://tldr.sh/assets/tldr.zip'
220
220
221
221
cachedir=$TLDR_CACHE_LOCATION
222
222
if [[ -z $cachedir ]]
@@ -229,7 +229,7 @@ Config(){
229
229
Err " Can't create the pages cache location $cachedir " &&
230
230
exit 4
231
231
# Indexes for every language should be available, $pages instead of pages
232
- index=$cachedir /pages/ index.json
232
+ index=$cachedir /index.json
233
233
# update if the file doesn't exists, or if it's older than $TLDR_EXPIRY
234
234
[[ -f $index ]] && Recent " $index " || Cache_fill
235
235
platforms=$( cd " $cachedir /pages" ; ls -d -- * / | tr -d /)
@@ -419,7 +419,7 @@ Cache_fill(){
419
419
exit 9
420
420
fi
421
421
rm -rf -- " ${cachedir:? } /" *
422
- mv -- " $tmp " /pages* " ${cachedir:? } /"
422
+ mv -- " $tmp /index.json " " $tmp " /pages* " ${cachedir:? } /"
423
423
rm -rf -- " $tmp "
424
424
Inf " Pages cached in $U$cachedir$XU "
425
425
updated=1
0 commit comments