-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: pass appropriate configs for file/dir modes
Re: https://npm.community/t/6-11-2-npm-ci-installs-package-with-wrong-permissions/9720 Still passing a plain old (non-Figgy Pudding) object into libcipm, duplicating the extra keys added in figgy-config.js. This is not a clean or nice or elegant solution, but it works, without regressing the config env var issue. Pairing with @claudiahdz
- Loading branch information
Showing
3 changed files
with
69 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const t = require('tap') | ||
const tar = require('tar') | ||
const common = require('../common-tap.js') | ||
const pkg = common.pkg | ||
const rimraf = require('rimraf') | ||
const { writeFileSync, statSync, chmodSync } = require('fs') | ||
const { resolve } = require('path') | ||
const mkdirp = require('mkdirp') | ||
|
||
t.test('setup', t => { | ||
mkdirp.sync(resolve(pkg, 'package')) | ||
const pj = resolve(pkg, 'package', 'package.json') | ||
writeFileSync(pj, JSON.stringify({ | ||
name: 'foo', | ||
version: '1.2.3' | ||
})) | ||
chmodSync(pj, 0o640) | ||
tar.c({ | ||
sync: true, | ||
file: resolve(pkg, 'foo.tgz'), | ||
gzip: true, | ||
cwd: pkg | ||
}, ['package']) | ||
writeFileSync(resolve(pkg, 'package.json'), JSON.stringify({ | ||
name: 'root', | ||
version: '1.2.3', | ||
dependencies: { | ||
foo: 'file:foo.tgz' | ||
} | ||
})) | ||
t.end() | ||
}) | ||
|
||
t.test('run install to generate package-lock', t => | ||
common.npm(['install'], { cwd: pkg }).then(([code]) => t.equal(code, 0))) | ||
|
||
t.test('remove node_modules', t => rimraf(resolve(pkg, 'node_modules'), t.end)) | ||
|
||
t.test('run ci and check modes', t => | ||
common.npm(['ci'], { cwd: pkg, stdio: 'inherit' }).then(([code]) => { | ||
t.equal(code, 0) | ||
const file = resolve(pkg, 'node_modules', 'foo', 'package.json') | ||
const mode = statSync(file).mode & 0o707 | ||
t.equal(mode, 0o604) | ||
})) |