|
2 | 2 |
|
3 | 3 | exports = module.exports = lifecycle
|
4 | 4 | exports.makeEnv = makeEnv
|
5 |
| -exports._incorrectWorkingDirectory = _incorrectWorkingDirectory |
6 | 5 |
|
7 | 6 | const spawn = require('./lib/spawn')
|
8 | 7 | const { execute } = require('@yarnpkg/shell')
|
@@ -75,12 +74,6 @@ function lifecycle (pkg, stage, wd, opts) {
|
75 | 74 | validWd(wd || path.resolve(opts.dir, pkg.name), (er, wd) => {
|
76 | 75 | if (er) return reject(er)
|
77 | 76 |
|
78 |
| - if ((wd.indexOf(opts.dir) !== 0 || _incorrectWorkingDirectory(wd, pkg)) && |
79 |
| - !opts.unsafePerm && pkg.scripts[stage]) { |
80 |
| - opts.log.warn(`"${stage}" script of "${pkg._id}" inside "${wd}" is skipped as the working directory seems suspicious. To run this lifecycle script anyway, use "--unsafe-perm".`) |
81 |
| - return resolve() |
82 |
| - } |
83 |
| - |
84 | 77 | // set the env variables, then run scripts as a child process.
|
85 | 78 | const env = makeEnv(pkg, opts)
|
86 | 79 | env.npm_lifecycle_event = stage
|
@@ -114,10 +107,6 @@ function lifecycle (pkg, stage, wd, opts) {
|
114 | 107 | })
|
115 | 108 | }
|
116 | 109 |
|
117 |
| -function _incorrectWorkingDirectory (wd, pkg) { |
118 |
| - return wd.lastIndexOf(pkg.name) !== wd.length - pkg.name.length |
119 |
| -} |
120 |
| - |
121 | 110 | function lifecycle_ (pkg, stage, wd, opts, env, cb) {
|
122 | 111 | env[PATH] = extendPath(wd, env[PATH], path.join(__dirname, 'node-gyp-bin'), opts)
|
123 | 112 |
|
|
0 commit comments