mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 03:17:46 -08:00
chore: update lerna configuration formatting chore: bump version in package.json to 6.0.0 fix: modify build scripts for improved readability and consistency feat: enhance translation scripts with better error handling and progress tracking chore: improve plugin creation script for better user experience style: format svgo configuration for consistency
33 lines
808 B
JavaScript
33 lines
808 B
JavaScript
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
import process from 'node:process'
|
|
import { glob } from 'glob'
|
|
|
|
export function getProjects() {
|
|
return glob
|
|
.sync('packages/*')
|
|
.sort()
|
|
.filter(item => !item.endsWith('artplayer-template') && !item.endsWith('artplayer-vitepress'))
|
|
.reduce((result, item) => {
|
|
const name = item.split(/\/|\\/g).pop()
|
|
result[name] = path.resolve(process.cwd(), item)
|
|
return result
|
|
}, {})
|
|
}
|
|
|
|
export function removeDir(dir) {
|
|
if (fs.existsSync(dir)) {
|
|
const files = fs.readdirSync(dir)
|
|
files.forEach((file) => {
|
|
const curPath = path.join(dir, file)
|
|
if (fs.statSync(curPath).isDirectory()) {
|
|
removeDir(curPath)
|
|
}
|
|
else {
|
|
fs.unlinkSync(curPath)
|
|
}
|
|
})
|
|
fs.rmdirSync(dir)
|
|
}
|
|
}
|