Make sure fix lockfile uses the correct file path
This commit is contained in:
		
							parent
							
								
									aacec26d0e
								
							
						
					
					
						commit
						42ef48b34d
					
				| @ -5,6 +5,7 @@ | |||||||
| // https://github.com/aragon/aragon-cli/blob/master/docs-internal/Dependencies.md#regenerate-the-lockfiles
 | // https://github.com/aragon/aragon-cli/blob/master/docs-internal/Dependencies.md#regenerate-the-lockfiles
 | ||||||
| 
 | 
 | ||||||
| const fs = require('fs') | const fs = require('fs') | ||||||
|  | const path = require('path') | ||||||
| 
 | 
 | ||||||
| function replaceAll(string, mapObject) { | function replaceAll(string, mapObject) { | ||||||
|   const regex = new RegExp(Object.keys(mapObject).join('|'), 'gi') |   const regex = new RegExp(Object.keys(mapObject).join('|'), 'gi') | ||||||
| @ -21,11 +22,12 @@ async function fixLockfile(path, replacementMap) { | |||||||
|   const originalText = JSON.stringify(originalJson, null, 2) |   const originalText = JSON.stringify(originalJson, null, 2) | ||||||
|   const fixedText = replaceAll(originalText, replacementMap) |   const fixedText = replaceAll(originalText, replacementMap) | ||||||
|   const fixedJson = JSON.parse(fixedText) |   const fixedJson = JSON.parse(fixedText) | ||||||
|  |   console.log('writing file', path); | ||||||
|   await fs.writeFileSync(path, JSON.stringify(fixedJson, null, 2)) |   await fs.writeFileSync(path, JSON.stringify(fixedJson, null, 2)) | ||||||
| } | } | ||||||
| //
 | //
 | ||||||
| 
 | 
 | ||||||
| const LOCKFILE_PATH = '../package-lock.json' | const LOCKFILE_PATH = path.join(__dirname, '..', 'package-lock.json') | ||||||
| 
 | 
 | ||||||
| const replacementMap = { | const replacementMap = { | ||||||
|   //
 |   //
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user