summaryrefslogtreecommitdiff
path: root/createworkdir
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernandez <hahj87@gmail.com>2011-03-25 07:09:23 -0700
committerJoshua Ismael Haase Hernandez <hahj87@gmail.com>2011-03-25 07:09:23 -0700
commit691baba22e7fb1fe47005558ca92e540566fe383 (patch)
tree8fc6367afbe472c51664ff2edf0310715b8712dd /createworkdir
parent5f47cf2a8f096f284bb1a9278fa676960ae65847 (diff)
Added libremessages and format in scripts
Diffstat (limited to 'createworkdir')
-rwxr-xr-xcreateworkdir31
1 files changed, 19 insertions, 12 deletions
diff --git a/createworkdir b/createworkdir
index 2589a8a..8680215 100755
--- a/createworkdir
+++ b/createworkdir
@@ -25,18 +25,25 @@ source /etc/libretools.conf
custom_config=$XDG_CONFIG_HOME/libretools/libretools.conf
[[ -e $custom_config ]] && source $custom_config
-# Send every output to /dev/null
-stdnull=">/dev/null 2>&1"
-
# Create the WORKDIR
[[ ! -d ${WORKDIR} ]] && {
- echo "Creating WORKDIR on ${WORKDIR}"
- mkdir -p ${WORKDIR} ${stdnull} || exit 1
+ msg "Creating WORKDIR on ${WORKDIR}"
+ stdnull "mkdir -p ${WORKDIR}" ||{
+ error "Could not create ${WORKDIR}"
+ exit 1
+ }
}
[[ ! -d ${WORKDIR}/abslibre/.git ]] && {
- echo "Cloning into ABSLibre"
- git clone ${ABSLIBREGIT} ${WORKDIR}/abslibre || exit 1
+ msg "Cloning into ABSLibre"
+ CMD="git clone ${ABSLIBREGIT} ${WORKDIR}/abslibre"
+ ${CMD} || {
+ error "Could not clone ABSLibre"
+ plain "Try running this command:"
+ echo
+ plain "${CMD}"
+ exit 1
+ }
}
@@ -44,23 +51,23 @@ stdnull=">/dev/null 2>&1"
_repodir=${WORKDIR}/repos
for _repo in ${REPOS[@]}; do
[[ ! -d ${WORKDIR}/staging/${_repo} ]] && {
- mkdir -p ${WORKDIR}/staging/${_repo} ${stdnull} || {
- echo "ERROR: Can't create ${WORKDIR}/staging/${_repo}"
+ stdnull "mkdir -p ${WORKDIR}/staging/${_repo}" || {
+ error "Can't create ${WORKDIR}/staging/${_repo}"
exit 1
}
}
for _arch in ${ARCHES[@]}; do
[[ ! -d ${_repodir}/${_repo}/${_arch} ]] && {
- mkdir -p ${_repodir}/${_repo}/${_arch} ${stdnull} || {
- echo "ERROR: Can't create ${_repodir}/${_repo}/${_arch}"
+ stdnull "mkdir -p ${_repodir}/${_repo}/${_arch}" || {
+ error "Can't create ${_repodir}/${_repo}/${_arch}"
exit 1
}
}
done
done
-echo "All done, your packaging dir tree looks like this now:"
+msg "Finished, your packaging dir tree looks like this now:"
ls --color=always ${WORKDIR}/*/*
exit 0