don't write file if main is `index`
Merge pull request #30 from ntran13/patch-1

don't write file if main is `index`