[cmd_update] Now updates DB_FILE with new commit hash when database update success
This commit is contained in:
parent
df69dbe70e
commit
a22a2d1575
1 changed files with 1 additions and 1 deletions
|
@ -30,5 +30,5 @@ cmd_update() {
|
|||
_msg EXEC "Updating database from ${OLD_COMMIT} to ${NEW_COMMIT}"
|
||||
db_update "${GIT_DIR}" "${TARGET}" "${DB_FILE}" ${imageidList[@]}
|
||||
[[ $? -ne 0 ]] && { _msg WARN; local ERR=true; } || _msg OK
|
||||
[[ ${ERR} ]] && return 1 || return 0
|
||||
[[ ${ERR} ]] && return 1 || { awk -v newcommit=${NEW_COMMIT} 'BEGIN{FS="\t"}{if($1=="LAST_COMMIT"){$2=newcommit}{print $0}}' ${DB_FILE} > ${DB_FILE}.tmp; mv ${DB_FILE}.tmp ${DB_FILE}; return 0; }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue