Permalink
Browse files

Lets fix user folder creation.

  • Loading branch information...
1 parent dbcd4e7 commit bbf5ca72df3e926611f337bab70fd14fa5391ab8 @DanBUK DanBUK committed Aug 3, 2011
Showing with 9 additions and 5 deletions.
  1. +8 −4 bin/create_user_dir.js
  2. +1 −1 lib/user.js
@@ -3,18 +3,22 @@
var exec = require('child_process').exec;
var config = require('../config.js').opt;
-var cmd = 'mkdir ' + process.argv[2];
+var dirs_string = config.git_home_dir + '/' + process.argv[2] + ' ' + config.apps_home_dir + '/' + process.argv[2];
var cmds = [
- 'mkdir ' + process.argv[2],
- 'chown ' + config.userid + ':' + config.userid + ' ' + process.argv[2]
+ 'mkdir ' + dirs_string,
+ 'chown ' + config.git_user + ':' + config.app_uid + ' ' + dirs_string,
+ 'chmod 0775 ' + dirs_string
+
];
var do_cmd = function () {
if (cmds.length > 0) {
var cmd = cmds.shift();
+ console.log('Running: ' + cmd);
exec(cmd, function () {
do_cmd();
});
}
-};
+};
+do_cmd();
View
@@ -118,7 +118,7 @@ module.exports = {
res.end();
} else {
exec('sudo ' + config.opt.app_dir + '/scripts/update_authkeys.js ' + config.opt.git_home_dir + '/' + newuser + ' "' + rsakey + '"');
- exec('sudo ' + config.opt.app_dir + '/scripts/create_user_dir.js ' + config.opt.git_home_dir + '/' + newuser);
+ exec('sudo ' + config.opt.app_dir + '/bin/create_user_dir.js ' + newuser);
db.save(newuser, {
password: lib.md5(newpass),
email: email

0 comments on commit bbf5ca7

Please sign in to comment.