mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-14 03:11:19 -06:00
19 lines
385 B
JavaScript
19 lines
385 B
JavaScript
const { execa, hasProjectGit } = require('@vue/cli-shared-utils')
|
|
|
|
module.exports = async function getChangedFiles (context) {
|
|
if (!hasProjectGit(context)) return []
|
|
|
|
const { stdout } = await execa('git', [
|
|
'ls-files',
|
|
'-o',
|
|
'--exclude-standard',
|
|
'--full-name'
|
|
], {
|
|
cwd: context
|
|
})
|
|
if (stdout.trim()) {
|
|
return stdout.split(/\r?\n/g)
|
|
}
|
|
return []
|
|
}
|