implement -c

This commit is contained in:
Vincent Riquer 2013-04-08 02:57:10 +02:00
parent 1a9758a251
commit 37df18f45d
3 changed files with 8 additions and 5 deletions

8
atom
View File

@ -43,6 +43,8 @@ declare -r \
\
oldIFS="$IFS"
cffile="$HOME/.atom/atom.cfg"
LC_ALL=C
shopt -s extglob
@ -96,16 +98,16 @@ done
#FIXME: check sanity
if [ ! -f ~/.atom/atom.cfg ]
if [ ! -f "$cffile" ]
then
if [ ! -d ~/.atom ]
then
mkdir -p ~/.atom
fi
sed "s:%HOME%:$HOME:" "$exampleconf" > ~/.atom/atom.cfg
sed "s:%HOME%:$HOME:" "$exampleconf" > "$cffile"
cat >&2 <<-EOCfgNotice
No configuration file found!
An example file has been created as ~/.atom/atom.cfg.
An example file has been created as "${cffile/$HOME/~}".
You should change it to your likings using you favorite editor.
Bailing out.

View File

@ -24,5 +24,5 @@ getConfig() {
getConfig$context
;;
esac
done < ~/.atom/atom.cfg
done < "$cffile"
}

View File

@ -2,7 +2,8 @@
printConfig() {
{
cat <<-EOF
General|Load|$maxload
General|Config file|$cffile
|Load|$maxload
|Load Interval|$loadinterval
|Temp Dir|$tempdir
|Database|$database