binary updater, no errors ffrom fastdu
This commit is contained in:
@@ -55,7 +55,7 @@ function processfolder() {
|
||||
}
|
||||
|
||||
function countfiles() {
|
||||
SIZE=$( find "$@" -type f -printf %s"\n" | awk '{ sum += 1 } END { print int(sum)+0 }' )
|
||||
SIZE=$( find "$@" -type f -printf %s"\n" 2>/dev/null | awk '{ sum += 1 } END { print int(sum)+0 }' )
|
||||
[[ "$HUMAN" -eq 1 ]] && {
|
||||
SIZE=$( siprefix "$SIZE" )
|
||||
}
|
||||
@@ -63,7 +63,7 @@ function countfiles() {
|
||||
}
|
||||
|
||||
function displaysize() {
|
||||
SIZE=$( find "$@" -type f -printf %s"\n" | awk '{ sum += $1 } END { print int(sum)+0 }' )
|
||||
SIZE=$( find "$@" -type f -printf %s"\n" 2>/dev/null | awk '{ sum += $1 } END { print int(sum)+0 }' )
|
||||
[[ "$HUMAN" -eq 1 ]] && {
|
||||
SIZE=$( filesize "$SIZE" )
|
||||
}
|
||||
|
||||
39
rc
39
rc
@@ -14,19 +14,36 @@ PATH=$PATH:"$QTOOLSPATH"/bin
|
||||
. "$QTOOLSPATH"/qcd_function
|
||||
path_remove_duplicates
|
||||
[[ -f "$QTOOLSPATH"/tsv/tsvkit.sh ]] && . "$QTOOLSPATH"/tsv/tsvkit.sh &>/dev/null
|
||||
function _q-tools-reload {
|
||||
# reload self
|
||||
[[ -z "$QTOOLSPATH" ]] && return
|
||||
source "$QTOOLSPATH"/rc
|
||||
}
|
||||
function _q-tools-update {
|
||||
# update self
|
||||
[[ -z "$QTOOLSPATH" ]] && return
|
||||
[[ -w "$QTOOLSPATH" ]] || return
|
||||
"$QTOOLSPATH"/rc -u
|
||||
_q-tools-reload
|
||||
|
||||
function _q-tools-reload {
|
||||
# reload self
|
||||
[[ -z "$QTOOLSPATH" ]] && return
|
||||
source "$QTOOLSPATH"/rc
|
||||
}
|
||||
|
||||
function _q-tools-update {
|
||||
# update self
|
||||
[[ -z "$QTOOLSPATH" ]] && return
|
||||
[[ -w "$QTOOLSPATH" ]] || return
|
||||
"$QTOOLSPATH"/rc -u
|
||||
_q-tools-reload
|
||||
}
|
||||
|
||||
function _q-tools-update-binary {
|
||||
# update self
|
||||
[[ -z "$QTOOLSPATH" ]] && return
|
||||
[[ -w "$QTOOLSPATH" ]] || return
|
||||
[[ -f "$QTOOLSPATH"/.hg_archival.txt ]] || return
|
||||
local foo
|
||||
echo "Updating with binary deletes the existing folder! sure? y/N"
|
||||
read foo
|
||||
[[ "$foo" = y ]] || return
|
||||
rm -rf "$QTOOLSPATH"
|
||||
mkdir -p "$QTOOLSPATH"
|
||||
curl https://bitbucket.org/MoonQ/tools/get/tip.tar.gz | \
|
||||
tar xz --strip 1 -C "$QTOOLSPATH"
|
||||
_q-tools-reload
|
||||
}
|
||||
|
||||
function _self_update() {
|
||||
touch "$QTOOLSPATH"/.lastupdate
|
||||
|
||||
Reference in New Issue
Block a user