binary updater, no errors ffrom fastdu
This commit is contained in:
@@ -55,7 +55,7 @@ function processfolder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function countfiles() {
|
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 ]] && {
|
[[ "$HUMAN" -eq 1 ]] && {
|
||||||
SIZE=$( siprefix "$SIZE" )
|
SIZE=$( siprefix "$SIZE" )
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ function countfiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function displaysize() {
|
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 ]] && {
|
[[ "$HUMAN" -eq 1 ]] && {
|
||||||
SIZE=$( filesize "$SIZE" )
|
SIZE=$( filesize "$SIZE" )
|
||||||
}
|
}
|
||||||
|
|||||||
17
rc
17
rc
@@ -14,11 +14,13 @@ PATH=$PATH:"$QTOOLSPATH"/bin
|
|||||||
. "$QTOOLSPATH"/qcd_function
|
. "$QTOOLSPATH"/qcd_function
|
||||||
path_remove_duplicates
|
path_remove_duplicates
|
||||||
[[ -f "$QTOOLSPATH"/tsv/tsvkit.sh ]] && . "$QTOOLSPATH"/tsv/tsvkit.sh &>/dev/null
|
[[ -f "$QTOOLSPATH"/tsv/tsvkit.sh ]] && . "$QTOOLSPATH"/tsv/tsvkit.sh &>/dev/null
|
||||||
|
|
||||||
function _q-tools-reload {
|
function _q-tools-reload {
|
||||||
# reload self
|
# reload self
|
||||||
[[ -z "$QTOOLSPATH" ]] && return
|
[[ -z "$QTOOLSPATH" ]] && return
|
||||||
source "$QTOOLSPATH"/rc
|
source "$QTOOLSPATH"/rc
|
||||||
}
|
}
|
||||||
|
|
||||||
function _q-tools-update {
|
function _q-tools-update {
|
||||||
# update self
|
# update self
|
||||||
[[ -z "$QTOOLSPATH" ]] && return
|
[[ -z "$QTOOLSPATH" ]] && return
|
||||||
@@ -27,6 +29,21 @@ function _q-tools-update {
|
|||||||
_q-tools-reload
|
_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() {
|
function _self_update() {
|
||||||
touch "$QTOOLSPATH"/.lastupdate
|
touch "$QTOOLSPATH"/.lastupdate
|
||||||
|
|||||||
Reference in New Issue
Block a user