-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure read and write permission like npm (#245)
- Loading branch information
1 parent
5ea123d
commit 87615ef
Showing
4 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const rimraf = require('rimraf'); | ||
const coffee = require('coffee'); | ||
const npminstall = path.join(__dirname, '../bin/install.js'); | ||
|
||
if (process.platform !== 'win32') { | ||
describe('test/fmode.test.js', () => { | ||
const homedir = path.join(__dirname, 'fixtures', '.tmp'); | ||
|
||
function cleanup() { | ||
rimraf.sync(homedir); | ||
} | ||
|
||
beforeEach(() => { | ||
cleanup(); | ||
fs.mkdir(homedir); | ||
}); | ||
afterEach(cleanup); | ||
|
||
it('should fix file mode success', function* () { | ||
yield coffee.fork(npminstall, [ 'array-unique@0.2.1' ], { | ||
cwd: homedir, | ||
}) | ||
.debug() | ||
.end(); | ||
const stat = fs.statSync(path.join(homedir, 'node_modules/array-unique/index.js')); | ||
// 700 -> 744 | ||
assert(stat.mode === 33252); | ||
}); | ||
}); | ||
} |