diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-09 14:39:25 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-09 14:39:25 +0100 |
commit | 889325999e1755b57631d380a048b365ea26fc37 (patch) | |
tree | 7c3f1e61ae319d4a58a902f77f05491007926c93 /scripts/sdks/agl | |
parent | 4119f6ebcabfb4285fb2456f10461cee57c6560a (diff) |
Create sdk directory when needed.
Diffstat (limited to 'scripts/sdks/agl')
-rwxr-xr-x | scripts/sdks/agl/db-update | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/sdks/agl/db-update b/scripts/sdks/agl/db-update index 4f8d933..68bd26a 100755 --- a/scripts/sdks/agl/db-update +++ b/scripts/sdks/agl/db-update @@ -23,6 +23,12 @@ sdksDBFile=${1} [ "${sdksDBFile}" = "" ] && sdksDBFile=${SDK_ROOT_DIR}/sdks_latest.json +# Backup previous file [ -f "${sdksDBFile}" ] && mv "${sdksDBFile}" "${sdksDBFile}.old" +# Create destination directory when needed +instDir=$(dirname "${sdksDBFile}") +[ ! -d "${instDir}" ] && mkdir -p "${instDir}" + +# Get database wget -q --connect-timeout=30 "${SDK_DATABASE}" -O "${sdksDBFile}" |