mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
22 lines
483 B
TypeScript
22 lines
483 B
TypeScript
import process from 'child_process'
|
|
|
|
const excludePatterns = [
|
|
/^docs?\//,
|
|
/^\.vscode\//,
|
|
/^\.git/,
|
|
/^builder\//,
|
|
/^images\//,
|
|
/^min\//,
|
|
/^README\.md$/,
|
|
/^CHANGELOG\.md$/,
|
|
/^CODE_OF_CONDUCT\.md$/,
|
|
/^LICENCE$/,
|
|
]
|
|
|
|
export const isSourceChanged = () => {
|
|
const lastDiff = process.execSync('git diff --name-only HEAD^').toString().trim().split('\n')
|
|
|
|
const isAllExcluded = lastDiff.every(path => excludePatterns.some(p => p.test(path)))
|
|
return !isAllExcluded
|
|
}
|