mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 18:08:11 +00:00 
			
		
		
		
	
		
			
	
	
		
			24 lines
		
	
	
		
			672 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			24 lines
		
	
	
		
			672 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
|   | const { join } = require('path'); | ||
|  | const execa = require('execa'); | ||
|  | const fs = require('fs-extra'); | ||
|  | const { promisify } = require('util'); | ||
|  | const glob = promisify(require('glob').glob); | ||
|  | 
 | ||
|  | async function run() { | ||
|  |   const packageDirs = await glob('packages/*'); | ||
|  | 
 | ||
|  |   console.log('Unlinking all packages'); | ||
|  | 
 | ||
|  |   const packages = packageDirs.map(dir => ({ | ||
|  |     dir, | ||
|  |     pkgJSON: fs.readJSONSync(join(dir, 'package.json')), | ||
|  |   })); | ||
|  | 
 | ||
|  |   await Promise.all(packages.map(({ dir }) => execa('yarn', ['unlink'], { cwd: dir }))); | ||
|  | 
 | ||
|  |   const packageNames = packages.map(p => p.pkgJSON.name).join(' '); | ||
|  |   console.log(`Package names: \n ${packageNames}\n`); | ||
|  | } | ||
|  | 
 | ||
|  | run().catch(err => console.error(err)); |