Merge pull request #40 from itoffshore/alpine

fix POSIX shell compatibility
This commit is contained in:
Mitchell Krog 2017-04-27 16:05:53 +02:00 committed by GitHub
commit 1837a25e50

View file

@ -91,7 +91,7 @@ check_if_updating() {
download_files() { download_files() {
local url= x= local_file= remote_dir=$1 local_dir=$2 local url= x= local_file= remote_dir=$1 local_dir=$2
local file_list=$(echo $@ | awk '{$1="",$2=""; print}') local file_list=$(echo $@ | awk '{$1=$2=""; print $0}')
local col_size=$(( $(longest_str $file_list) + $(echo $remote_dir | wc -m) )) local col_size=$(( $(longest_str $file_list) + $(echo $remote_dir | wc -m) ))
if [ -n "$(check_if_updating $local_dir $file_list)" ]; then if [ -n "$(check_if_updating $local_dir $file_list)" ]; then
@ -234,7 +234,8 @@ main() {
if [ -n "$(check_online $include_url)" ]; then if [ -n "$(check_online $include_url)" ]; then
local tmp=$(mktemp) local tmp=$(mktemp)
wget -q $include_url -O $tmp wget -q $include_url -O $tmp
source $tmp 2>/dev/null # use period not source in POSIX shell
. $tmp 2>/dev/null
rm -f $tmp rm -f $tmp
else else
printf "Repo down or missing: $include_url\n" printf "Repo down or missing: $include_url\n"