tower-archive / tower

UNMAINTAINED - Small components for building apps, manipulating data, and automating a distributed infrastructure.
http://tower.github.io
MIT License
1.79k stars 120 forks source link

tower new appname creates directories without read permissions... #399

Closed aharbick closed 10 years ago

aharbick commented 11 years ago

aharbick.local:~/Projects/Personal$ node -v v0.10.3 aharbick.local:~/Projects/Personal$ tower new testapp create : testapp/.gitignore create : testapp/.npmignore create : testapp/.slugignore ....

aharbick.local:~/Projects/Personal$ ls -ld testapp d-wxrw---x 21 aharbick staff 714 Apr 27 11:14 testapp aharbick.local:~/Projects/Personal$ ls -l testapp/ ls: : Permission denied

The call to fs.mkdirSync(dir, parseInt('0755')) in tower-generator/server/actions.js is essentially going to call: fs.mkdirSync(dir, 755);

losing the octal value 0755 and that seems to be the problem... If instead I just pass in an octal in node you can see the different results... aharbick.local:~/Projects/Personal$ node

fs = require('fs') fs.mkdirSync('/var/tmp/dir1', parseInt('0755')) undefined fs.mkdirSync('/var/tmp/dir2', 0755) undefined fs.mkdirSync('/var/tmp/dir3', 0666) undefined

aharbick.local:~/Projects/Personal/tower$ ls -ld /var/tmp/dir* d-wxrw---x 2 aharbick wheel 68 Apr 27 11:24 /var/tmp/dir1 drwxr-xr-x 2 aharbick wheel 68 Apr 27 11:24 /var/tmp/dir2 drw-rw-r-- 2 aharbick wheel 68 Apr 27 11:24 /var/tmp/dir3

Can you confirm that I'm not doing something wrong before I fork and create a pull request?

aharbick commented 11 years ago

P.S. OS X 10.6.8

aharbick commented 11 years ago

This is what the diff looks like... https://github.com/aharbick/tower/commit/fbbcc2bb1fb28977f34898968c790fb7156b33cb

pocesar commented 11 years ago

parseInt('0755', 8) or just make it use 0755, the same effect (Javascript supports octals without the need of extra parseInt)