From 4119f6ebcabfb4285fb2456f10461cee57c6560a Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Mon, 8 Jan 2018 18:17:29 +0100 Subject: Fixed sdks db-update name and backup prev version. --- scripts/sdks/agl/db-dump | 4 ++-- scripts/sdks/agl/db-update | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/sdks/agl/db-dump b/scripts/sdks/agl/db-dump index e13a8d8..aa8b30d 100755 --- a/scripts/sdks/agl/db-dump +++ b/scripts/sdks/agl/db-dump @@ -1,7 +1,7 @@ #! /usr/bin/env nodejs /************************************************************************** - * Copyright 2017 IoT.bzh + * Copyright 2017-2018 IoT.bzh * * author: Sebastien Douheret * @@ -43,7 +43,7 @@ sdksDBFile = path.join(envMap["SDK_ROOT_DIR"], "sdks_latest.json") try { // Fetch SDK Json database file when not existing if (!fs.existsSync(sdksDBFile)) { - var data = execSync(path.join(__dirname, 'update-db ' + sdksDBFile), opts); + var data = execSync(path.join(__dirname, 'db-update ' + sdksDBFile), opts); } // Read SDK Json database file var data = fs.readFileSync(sdksDBFile); diff --git a/scripts/sdks/agl/db-update b/scripts/sdks/agl/db-update index a222db9..4f8d933 100755 --- a/scripts/sdks/agl/db-update +++ b/scripts/sdks/agl/db-update @@ -1,6 +1,6 @@ #!/bin/bash ########################################################################### -# Copyright 2017 IoT.bzh +# Copyright 2017-2018 IoT.bzh # # author: Sebastien Douheret # @@ -19,4 +19,10 @@ . $(dirname "$0")/_env-init.sh -wget -q --connect-timeout=30 ${SDK_DATABASE} -O $1 +sdksDBFile=${1} + +[ "${sdksDBFile}" = "" ] && sdksDBFile=${SDK_ROOT_DIR}/sdks_latest.json + +[ -f "${sdksDBFile}" ] && mv "${sdksDBFile}" "${sdksDBFile}.old" + +wget -q --connect-timeout=30 "${SDK_DATABASE}" -O "${sdksDBFile}" -- cgit 1.2.3-korg