Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
2bd45228
Commit
2bd45228
authored
7 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
fix(npm): Run npm install with —ignore-scripts
parent
cd762c7b
Branches
Branches containing commit
Tags
v9.23.3
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/workers/branch/index.js
+1
-2
1 addition, 2 deletions
lib/workers/branch/index.js
lib/workers/branch/npm.js
+16
-5
16 additions, 5 deletions
lib/workers/branch/npm.js
with
17 additions
and
7 deletions
lib/workers/branch/index.js
+
1
−
2
View file @
2bd45228
...
...
@@ -68,7 +68,6 @@ async function ensureBranch(config) {
const
commitMessage
=
handlebars
.
compile
(
config
.
commitMessage
)(
config
);
const
api
=
config
.
api
;
const
versions
=
config
.
versions
;
const
cacheFolder
=
config
.
yarnCacheFolder
;
const
packageFiles
=
{};
const
commitFiles
=
[];
...
...
@@ -144,7 +143,7 @@ async function ensureBranch(config) {
packageFiles
[
packageFile
],
api
,
config
.
versions
.
npm
,
versions
.
npm
logger
);
if
(
packageLockFile
)
{
// Add new package-lock.json file too
...
...
This diff is collapsed.
Click to expand it.
lib/workers/branch/npm.js
+
16
−
5
View file @
2bd45228
const
logger
=
require
(
'
../../logger
'
);
const
fs
=
require
(
'
fs
'
);
const
cp
=
require
(
'
child_process
'
);
const
tmp
=
require
(
'
tmp
'
);
const
path
=
require
(
'
path
'
);
let
logger
=
require
(
'
../../logger
'
);
module
.
exports
=
{
generateLockFile
,
getLockFile
,
...
...
@@ -20,12 +21,14 @@ async function generateLockFile(newPackageJson, npmrcContent) {
fs
.
writeFileSync
(
path
.
join
(
tmpDir
.
name
,
'
.npmrc
'
),
npmrcContent
);
}
logger
.
debug
(
'
Spawning npm install
'
);
const
result
=
cp
.
spawnSync
(
'
npm
'
,
[
'
install
'
],
{
const
result
=
cp
.
spawnSync
(
'
npm
'
,
[
'
install
'
,
'
--ignore-scripts
'
],
{
cwd
:
tmpDir
.
name
,
shell
:
true
,
});
logger
.
debug
(
String
(
result
.
stdout
));
logger
.
debug
(
String
(
result
.
stderr
));
logger
.
debug
(
{
stdout
:
String
(
result
.
stdout
),
stderr
:
String
(
result
.
stderr
)
},
'
npm install complete
'
);
packageLock
=
fs
.
readFileSync
(
path
.
join
(
tmpDir
.
name
,
'
package-lock.json
'
));
}
catch
(
error
)
/* istanbul ignore next */
{
try
{
...
...
@@ -43,7 +46,14 @@ async function generateLockFile(newPackageJson, npmrcContent) {
return
packageLock
;
}
async
function
getLockFile
(
packageFile
,
packageContent
,
api
,
npmVersion
)
{
async
function
getLockFile
(
packageFile
,
packageContent
,
api
,
npmVersion
,
parentLogger
)
{
logger
=
parentLogger
||
logger
;
// Detect if a package-lock.json file is in use
const
packageLockFileName
=
path
.
join
(
path
.
dirname
(
packageFile
),
...
...
@@ -78,6 +88,7 @@ async function getLockFile(packageFile, packageContent, api, npmVersion) {
}
async
function
maintainLockFile
(
inputConfig
)
{
logger
=
inputConfig
.
logger
||
logger
;
logger
.
trace
({
config
:
inputConfig
},
`maintainLockFile`
);
const
packageContent
=
await
inputConfig
.
api
.
getFileContent
(
inputConfig
.
packageFile
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment