View previous topic :: View next topic |
Author |
Message |
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Thu Feb 08, 2018 2:02 pm Post subject: Git - check file exist on online repository |
|
|
Hello, can you know with git cli how to check if file exist on git online repository ? (public repository) |
|
Back to top |
|
|
ct85711 Veteran
Joined: 27 Sep 2005 Posts: 1791
|
|
Back to top |
|
|
richardfullers n00b
Joined: 11 Feb 2018 Posts: 1
|
Posted: Mon Feb 12, 2018 1:20 pm Post subject: This command may be helpful. |
|
|
function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
} |
|
Back to top |
|
|
P.Kosunen Guru
Joined: 21 Nov 2005 Posts: 309 Location: Finland
|
Posted: Tue Feb 13, 2018 12:49 pm Post subject: Re: This command may be helpful. |
|
|
richardfullers wrote: | function validate_url(){
if [[ `wget -S --spider $1 2>&1 | grep 'HTTP/1.1 200 OK'` ]]; then echo "true"; fi
} |
Useless use of grep.
Code: | wget -q -O /dev/null https://[RAW-FILE-URL] && echo "Success" |
Code: | wget -q -O /dev/null https://[RAW-FILE-URL] || echo "Failed" |
|
|
Back to top |
|
|
|