|
@ -8,13 +8,13 @@ GOGOCARTO_URL=https://docker.0k.io/downloads/gogocarto-"${GOGOCARTO_RELEASE}".ta |
|
|
|
|
|
|
|
|
gogocarto:init() { |
|
|
gogocarto:init() { |
|
|
current_version="" |
|
|
current_version="" |
|
|
if [ -d "${GOGOCARTO_CODE}" ]; then |
|
|
|
|
|
current_version=$(cat "${GOGOCARTO_CODE}"/.version) || { |
|
|
|
|
|
err "Couldn't find ${GOGOCARTO_CODE}/.version file." |
|
|
|
|
|
echo " Your config dir is in a broken state." >&2 |
|
|
|
|
|
return 1 |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
|
|
|
if [ -e "${GOGOCARTO_CODE}/.version" ]; then |
|
|
|
|
|
current_version="$(cat "${GOGOCARTO_CODE}/.version")" || return 1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
## Note: previous content will be removed, if not in `.git` and no |
|
|
|
|
|
## version matching current one |
|
|
|
|
|
if ! [ -d "${GOGOCARTO_CODE}/.git" ]; then |
|
|
mkdir -p "${GOGOCARTO_CODE}" && |
|
|
mkdir -p "${GOGOCARTO_CODE}" && |
|
|
cd "${GOGOCARTO_CODE}" && |
|
|
cd "${GOGOCARTO_CODE}" && |
|
|
git init . && |
|
|
git init . && |
|
|