-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfetch_libs.sh
executable file
·44 lines (37 loc) · 1007 Bytes
/
fetch_libs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /usr/bin/env bash
case "$(uname -s)" in
Darwin)
echo 'Detected Mac OS X'
PACKAGE_FILENAME="dart_runtime_libs_1.8.5_macosx_x64.zip"
;;
Linux)
echo 'Error: Linux Platform not yet supported, exiting.'
exit 0
;;
CYGWIN*|MINGW*|MSYS*)
echo 'Detected MS Windows'
PACKAGE_FILENAME="dart_runtime_libs_1.8.5_msw_x64.zip"
;;
*)
echo 'Error: Unknown OS, returning.'
exit 0
;;
esac
PACKAGE_URL="https://dl.dropboxusercontent.com/u/3905723/cinder/dart-runtime-packages/"${PACKAGE_FILENAME}
PACKAGE_DEST="dart-runtime/lib"
DIR=$(dirname $0)
DEST_PATH=${DIR}"/"${PACKAGE_DEST}
echo "package url: ${PACKAGE_URL}"
echo "destination path: ${DEST_PATH}"
if [[ -d ${DEST_PATH} ]]
then
echo "destination folder already exists, removing old first"
rm -r ${DEST_PATH}
fi
curl -O ${PACKAGE_URL}
unzip ${PACKAGE_FILENAME} -d "package"
mkdir ${DEST_PATH}
mv -v "package/lib/"* ${DEST_PATH}"/"
# cleanup:
rm -rf package
rm ${PACKAGE_FILENAME}