mirror of
https://github.com/DictXiong/dotfiles.git
synced 2026-11-23 20:38:16 +08:00
[dev] refactor log.py -> logger.sh (#32)
* update.sh: fetch will prune * log: use hostname directly * refactor log.py to logger.sh (#31) * logger.sh: refactor log.py to bash script * update.sh use beacon; ci test beacon * install.sh: install dep first * install.sh: DFS_UPDATED_RET=85 * more beacon; use stderr * remove py3 dep * install.sh: remove py3 * install.sh: -s|--secure * async log; beacon add sys.login * update use sync beacon * fix ci minor bug; macos: uuidgen/e2fsprogs * logger.sh: not need to use uuid5 * bug fix * dfs err_return * common.sh: post_log and post_beacon will check #args * bug fix * zshrc: fix locale when C.UTF-8 not exists * WIP: combine install -a and tools/ scripts * finish combination; get_os_name; macos.sh * test.ci: now all use -a to install deps * bug fix * bug fix; ci: install.sh run with -x * install.sh: bug fix that re-run install.sh after updated needs orgin args * format Co-authored-by: xiongdian.me <xiongdian.me@bytedance.com>
This commit is contained in:
10
.update.sh
10
.update.sh
@@ -9,10 +9,10 @@ DFS_UPDATE_CHANNEL=${DFS_UPDATE_CHANNEL:-"main"}
|
||||
|
||||
# fetch origin
|
||||
cd $DOTFILES
|
||||
git fetch --all
|
||||
git fetch --all --prune
|
||||
if [[ -n "$(git status -s)" ]]; then
|
||||
fmt_error "directory not clean"
|
||||
post_log "ERROR" "$THIS_FILE" "directory not clean"
|
||||
apost_beacon "dfs.dirty"
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -25,18 +25,18 @@ case $DFS_UPDATE_CHANNEL in
|
||||
esac
|
||||
if [[ ${#DFS_COMMIT} != 40 ]]; then
|
||||
fmt_error "invalid commit id"
|
||||
post_log "ERROR" "$THIS_FILE" "invalid commit id: ${DFS_COMMIT}"
|
||||
apost_beacon "dfs.invalid-commit"
|
||||
apost_log "ERROR" "$THIS_FILE" "invalid commit id: ${DFS_COMMIT}"
|
||||
exit
|
||||
fi
|
||||
|
||||
# update
|
||||
if [[ "$(git rev-parse HEAD)" == "$DFS_COMMIT" ]]; then
|
||||
fmt_info "nothing to do"
|
||||
post_log "INFO" "$THIS_FILE" "nothing to do"
|
||||
else
|
||||
fmt_info "checking out to commit $DFS_COMMIT ..."
|
||||
if [[ -z "$DFS_DEV" ]]; then
|
||||
post_log "INFO" "$THIS_FILE" "will check out to commit $DFS_COMMIT"
|
||||
post_beacon "dfs.updated"
|
||||
git -c advice.detachedHead=false checkout $DFS_COMMIT
|
||||
cp ./.update.sh ./update.sh && chmod +x ./update.sh && exit $DFS_UPDATED_RET
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user