mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-09 05:16:23 +10:00
workflow: remote-version script for version checking
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user