Skip to content

Commit

Permalink
Merge 852a586 into 50ed13e
Browse files Browse the repository at this point in the history
  • Loading branch information
Utsav2 committed Nov 27, 2015
2 parents 50ed13e + 852a586 commit a5b36a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/resolvers/Resolver.js
Expand Up @@ -7,6 +7,7 @@ var rimraf = require('../../util/rimraf');
var readJson = require('../../util/readJson');
var createError = require('../../util/createError');
var removeIgnores = require('../../util/removeIgnores');
var md5 = require('md5-hex');

tmp.setGracefulCleanup();

Expand Down Expand Up @@ -145,7 +146,7 @@ Resolver.prototype._createTempDir = function () {
return Q.nfcall(mkdirp, this._config.tmp)
.then(function () {
return Q.nfcall(tmp.dir, {
template: path.join(this._config.tmp, this._name + '-' + process.pid + '-XXXXXX'),
template: path.join(this._config.tmp, md5(this._name) + '-' + process.pid + '-XXXXXX'),
mode: 0777 & ~process.umask(),
unsafeCleanup: true
});
Expand Down
12 changes: 12 additions & 0 deletions test/core/resolvers/resolver.js
Expand Up @@ -515,6 +515,18 @@ describe('Resolver', function () {
})
.done();
});

it('should remove @ from directory names', function (next) {
var resolver = create('foo@bar');

resolver._createTempDir()
.then(function (dir) {
expect(resolver._tempDir).to.be.ok();
expect(resolver._tempDir.indexOf('@')).to.equal(-1);
next();
})
.done();
});
});

describe('._cleanTempDir', function () {
Expand Down

0 comments on commit a5b36a5

Please sign in to comment.