hybridgroup / GitHub-Wikifier

A pre-commit Git Hook that will generate all the Table of Contents you will ever need. Just write your content, and let it take over.
100 stars 24 forks source link

Allow empty subdirs #6

Closed atz closed 11 years ago

atz commented 11 years ago

If there is no file, there is nothing to git add.  In practice there is no file when the subdir was otherwise empty.

MarioRicalde commented 11 years ago

add line if file exists? is this going to work without git before that?

atz commented 11 years ago

Not sure what you are asking. This revision is logically the same conditional check as:

if [[ -f $line ]] ; then
   git add $line
fi
MarioRicalde commented 11 years ago

I understand the conditional, what makes me wonder is that the line of code is:

[ -f $line ] && add $line

rather than:

[ -f $line ] && git add $line
atz commented 11 years ago

Hah, indeed, that was my intention.

atz commented 11 years ago

There we go.

MarioRicalde commented 11 years ago

There we go, I was wondering if it was just me not understanding something related to Shell Scripting.

Cheers