-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workflow: remote-version script for version checking
- Loading branch information
Showing
2 changed files
with
22 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
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,21 @@ | ||
const { join } = require('path') | ||
const { readdirSync } = require('fs') | ||
const chalk = require('chalk') | ||
const execa = require('execa') | ||
|
||
const PRIVATE_PACKAGES = ['theme-vue', 'theme-blog', '.DS_Store'] | ||
|
||
const scopePackages = readdirSync( | ||
join(__dirname, '../packages/@vuepress') | ||
) | ||
.filter(n => !PRIVATE_PACKAGES.includes(n)) | ||
.map(n => `@vuepress/${n}`) | ||
|
||
async function log () { | ||
await Promise.all(['vuepress', ...scopePackages].map(async pkg => { | ||
const version = (await execa('npm', ['view', `${pkg}@next`, 'version'])).stdout.toString() | ||
console.log(`${pkg}: ${chalk.cyan(version)}`) | ||
})) | ||
} | ||
|
||
log() |