Skip to content

Commit

Permalink
fix: add more information for #216
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Feb 14, 2024
1 parent 78cc978 commit 2bcf54f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.0
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ const restoreCachedNpm = npmCache => {
}

const saveCachedNpm = npmCache => {
console.log('saving NPM modules')
console.log('saving NPM modules under key %s', npmCache.primaryKey)
console.log('input paths: %o', npmCache.inputPaths)

return cache
.saveCache(
npmCache.inputPaths.slice(), // Copy inputPaths, to work arround bug reported in https://github.com/actions/toolkit/pull/1378
npmCache.primaryKey
)
.saveCache(npmCache.inputPaths, npmCache.primaryKey)
.catch(err => {
// don't throw an error if cache already exists, which may happen due to
// race conditions
Expand All @@ -64,6 +62,8 @@ const saveCachedNpm = npmCache => {

// do not rethrow here or github actions will break (https://github.com/bahmutov/npm-install/issues/142)
console.warn(`saving npm cache failed with ${err}, continuing...`)
console.warn('cache key %s', npmCache.primaryKey)
console.warn('input paths %o', npmCache.inputPaths)
})
}

Expand Down

0 comments on commit 2bcf54f

Please sign in to comment.