mirror of
https://github.com/mashirozx/sakura.git
synced 2024-11-14 19:08:12 +08:00
24 lines
512 B
JavaScript
24 lines
512 B
JavaScript
'use strict'
|
|
import { exec } from 'child_process'
|
|
import { readFileSync } from 'fs'
|
|
|
|
const json = JSON.parse(readFileSync('package.json'))
|
|
|
|
const dependencies = json.dependencies
|
|
|
|
let deps = ''
|
|
|
|
Object.keys(dependencies).forEach((key) => {
|
|
if (/@material\//.test(key)) deps += ` ${key}@canary `
|
|
})
|
|
|
|
const command = `yarn upgrade ${deps}`
|
|
|
|
console.log(command)
|
|
|
|
exec(command, (error, stdout, stderr) => {
|
|
if (error) console.error(error)
|
|
if (stderr) console.warn(stderr)
|
|
if (stdout) console.log(stdout)
|
|
})
|