add arguments to help and ignore orgfile
This commit is contained in:
parent
755982735c
commit
63f0a290a3
1 changed files with 27 additions and 2 deletions
29
generate.sh
29
generate.sh
|
@ -24,6 +24,28 @@ pathLinks="/home/site/a/"
|
|||
target="www"
|
||||
header="header.html"
|
||||
footer="footer.html"
|
||||
org=1
|
||||
|
||||
function print_help {
|
||||
echo "usage : generate.sh [-o] [<dossier>]"
|
||||
echo -e "\tgénère les fichiers HTML du site. Il est possible de changer"
|
||||
echo -e "\tle dossier de destination (www par défaut)."
|
||||
echo
|
||||
echo -e "\t-h\tgénère ce message et arrête le script."
|
||||
echo -e "\t-o\tne génère pas les fichiers org"
|
||||
}
|
||||
|
||||
# vérification des arguments passés
|
||||
if [[ $@ =~ "-h" ]]
|
||||
then
|
||||
print_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $@ =~ "-o" ]]
|
||||
then
|
||||
org=0
|
||||
fi
|
||||
|
||||
if [ -d $target ]
|
||||
then
|
||||
|
@ -48,5 +70,8 @@ cp -t $target -r $annexes
|
|||
echo "Link Links (lul)"
|
||||
ln -s $pathLinks $target
|
||||
|
||||
echo "Generate org files..."
|
||||
emacs -u $USER --script publish.el
|
||||
if [ $org -eq 1 ]
|
||||
then
|
||||
echo "Generate org files..."
|
||||
emacs -u $USER --script publish.el
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue