-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add script to mark current packages to latest
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import fs from 'fs'; | ||
import { execSync } from 'child_process'; | ||
import console from 'console'; | ||
|
||
// Mark all current packages as latest | ||
fs.readdirSync('./packages').forEach((packageName, index) => { | ||
if (packageName === 'g-devtool') return; | ||
|
||
const pkgJson = JSON.parse( | ||
fs.readFileSync(`./packages/${packageName}/package.json`, 'utf-8'), | ||
); | ||
|
||
const command = `npm dist-tag add ${pkgJson.name}@${pkgJson.version} latest`; | ||
console.log(`[${index}] ` + command); | ||
try { | ||
execSync(command); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
}); |