only chmod if the user has supplied a mode
merge upstream
Merge pull request #6 from MarkRoddy/master

Only chmod if the user has supplied a mode