Browse Source

moved curl checking loop

pull/914/head
Daniel Gibbs 9 years ago
parent
commit
a3bd7ffcd9
  1. 7
      lgsm/functions/command_update_functions.sh

7
lgsm/functions/command_update_functions.sh

@ -23,6 +23,9 @@ fi
if [ -n "${functionsdir}" ]; then if [ -n "${functionsdir}" ]; then
if [ -d "${functionsdir}" ]; then if [ -d "${functionsdir}" ]; then
cd "${functionsdir}"
for functionfile in *
do
# Check curl exists and use available path # Check curl exists and use available path
curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)" curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
for curlcmd in ${curlpaths} for curlcmd in ${curlpaths}
@ -32,9 +35,7 @@ if [ -n "${functionsdir}" ]; then
break break
fi fi
done done
cd "${functionsdir}"
for functionfile in *
do
echo -ne " checking ${functionfile}...\c" echo -ne " checking ${functionfile}...\c"
function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlcmd} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) function_file_diff=$(diff "${functionsdir}/${functionfile}" <(${curlcmd} -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
if [ "${function_file_diff}" != "" ]; then if [ "${function_file_diff}" != "" ]; then

Loading…
Cancel
Save