1
0
Fork 0

browser-home-profile/functions: Renamed pr_ prefix to pr- (minor fix)

pull/890/head
tokiclover 10 years ago
parent 522c723356
commit fffd53b57c

@ -13,31 +13,31 @@ function bhp {
for dir (${HOME}/.${PROFILE} ${HOME}/.cache/${PROFILE#config/}) { for dir (${HOME}/.${PROFILE} ${HOME}/.cache/${PROFILE#config/}) {
[[ -d ${dir} ]] || continue [[ -d ${dir} ]] || continue
pr_begin "Setting up tarball..." pr-begin "Setting up tarball..."
pushd -q ${dir:h} || continue pushd -q ${dir:h} || continue
if [[ -f ${profile}/.unpacked ]]; then if [[ -f ${profile}/.unpacked ]]; then
if [[ -f ${profile}${ext} ]] { if [[ -f ${profile}${ext} ]] {
mv -f ${profile}${ext} ${profile}.old${ext} || mv -f ${profile}${ext} ${profile}.old${ext} ||
{ pr_end 1 Moving; continue; } { pr-end 1 Moving; continue; }
} }
tar -X ${profile}/.unpacked -Ocp ${profile} | \ tar -X ${profile}/.unpacked -Ocp ${profile} | \
${=compressor} ${profile}${ext} || ${=compressor} ${profile}${ext} ||
{ pr_end 1 Packing; continue; } { pr-end 1 Packing; continue; }
else else
if [[ -f ${profile}${ext} ]]; then if [[ -f ${profile}${ext} ]]; then
tarball=${profile}${ext} tarball=${profile}${ext}
elif [[ -f ${profile}.old${ext} ]]; then elif [[ -f ${profile}.old${ext} ]]; then
tarball=${profile}.old${ext} tarball=${profile}.old${ext}
else else
pr_warn "No tarball found."; continue pr-warn "No tarball found."; continue
fi fi
${compressor[(w)1]} -cd ${tarball} | tar -xp && ${compressor[(w)1]} -cd ${tarball} | tar -xp &&
touch ${profile}/.unpacked || touch ${profile}/.unpacked ||
{ pr_end 1 Unpacking; continue; } { pr-end 1 Unpacking; continue; }
fi fi
popd -q popd -q
pr_end ${?} pr-end ${?}
} }
} }

@ -49,12 +49,12 @@ function mktmp {
done done
if ! ([[ ${#} == 1 ]] && [[ -n ${1} ]]); then if ! ([[ ${#} == 1 ]] && [[ -n ${1} ]]); then
pr_error "Invalid argument(s)" pr-error "Invalid argument(s)"
return 3 return 3
fi fi
case ${1} { case ${1} {
(*${temp}) ;; (*${temp}) ;;
(*) pr_error "Invalid TEMPLATE"; return 4;; (*) pr-error "Invalid TEMPLATE"; return 4;;
} }
if (( ${+commands[mktemp]} )); then if (( ${+commands[mktemp]} )); then
@ -68,7 +68,7 @@ function mktmp {
(*) [[ -e ${tmp} ]] || { mkdir -p ${tmp:h}; touch ${tmp}; };; (*) [[ -e ${tmp} ]] || { mkdir -p ${tmp:h}; touch ${tmp}; };;
} }
if (( ${?} != 0 )) { if (( ${?} != 0 )) {
pr_error "Failed to create ${tmp}" pr-error "Failed to create ${tmp}"
return 5 return 5
} }
[[ -h ${tmp} ]] && return [[ -h ${tmp} ]] && return

Loading…
Cancel
Save