New commits:
commit f5aff309e142605bad180d1dbf4ad1dc575ea798
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
bashrc: corrected jump, changed header usage
jump is now guaranteed to work (no errors on correct steps, errors on
incorrect ones), and will also be faster (no loop needed). Should
speed things up a little bit.
header now only does the header, instead of doing the header and then
cat'ing a file.
function jump() {
- local i
- local good=0
-
cat $INSTALLER_DATA/steps | cut -d" " -f1 |
- while read i
- do
- if [[ $* = $i ]]
- then
- good=1
- echo "$*" >$INSTALLER_STATUS
- todo
- return
- fi
- done
- echo ""
- [[ $good -eq 0 ]] && echo "Error: '$*' is not a recognized step."
+ grep -q "^$*" && {
+ echo "$*" >$INSTALLER_STATUS
+ todo
+ return 0
+ }
+ header
+ echo "Error: '$*' is not a recognized step."
echo "Type [1msteps[m to see a list of steps."
+ return 1
}
function help() {
helpfile=$INSTALLER_DOCS/help/${1:-index}
if [[ -e $helpfile ]] ;then
- header $helpfile
+ header
+ cat $helpfile
else
echo "No installer help for '$1', falling back to bash's builtin help"
builtin help $1
[SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (f5aff309e142605bad180d1dbf4ad1dc575ea798),
Justin Boffemmyer, 08/10/2008