From: Cheng Zhao Date: Mon, 3 Jun 2013 10:07:15 +0000 (+0800) Subject: Don't download frameworks if they exist. X-Git-Tag: v0.1.0~110 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=6a5842d03ac5563b98ed1c523a71ea85b26b85c1;p=electron.git Don't download frameworks if they exist. --- diff --git a/script/update-frameworks b/script/update-frameworks index 27a63ee1..38656af8 100755 --- a/script/update-frameworks +++ b/script/update-frameworks @@ -9,13 +9,15 @@ cd frameworks FRAMEWORKS_URL='https://gh-contractor-zcbenz.s3.amazonaws.com/frameworks' -trap 'rm *.zip' EXIT - -echo 'Downloading Quincy...' -polite_curl "$FRAMEWORKS_URL/Quincy.framework.zip" > Quincy.framework.zip - -echo 'Downloading Sparkle...' -polite_curl "$FRAMEWORKS_URL/Sparkle.framework.zip" > Sparkle.framework.zip - -unzip Quincy.framework.zip -unzip Sparkle.framework.zip +trap 'rm -f *.zip' EXIT + +function download_and_unzip() { + if ! [ -d $1.framework ]; then + echo "Downloading $1..." + polite_curl "$FRAMEWORKS_URL/$1.framework.zip" > $1.framework.zip + unzip $1.framework.zip + fi +} + +download_and_unzip Quincy +download_and_unzip Sparkle