feat(schematics): add an option to run affected:* by only specifying --base
This commit is contained in:
parent
f80061d37d
commit
eda5a13177
@ -117,11 +117,16 @@ function withAffectedOptions(yargs: yargs.Argv): yargs.Argv {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
requiresArg: true
|
requiresArg: true
|
||||||
})
|
})
|
||||||
.group(['base', 'head'], 'Run command using --base=[SHA1] --head=[SHA2]:')
|
.group(
|
||||||
|
['base'],
|
||||||
|
'Run command using --base=[SHA1] (affected by the committed, uncommitted and untracked changes):'
|
||||||
|
)
|
||||||
|
.group(
|
||||||
|
['base', 'head'],
|
||||||
|
'or using --base=[SHA1] --head=[SHA2] (affected by the committed changes):'
|
||||||
|
)
|
||||||
.group(['files', 'uncommitted', 'untracked'], 'or using:')
|
.group(['files', 'uncommitted', 'untracked'], 'or using:')
|
||||||
.implies('SHA1', 'SHA2')
|
|
||||||
.implies('head', 'base')
|
.implies('head', 'base')
|
||||||
.implies('base', 'head')
|
|
||||||
.nargs('uncommitted', 0)
|
.nargs('uncommitted', 0)
|
||||||
.nargs('untracked', 0)
|
.nargs('untracked', 0)
|
||||||
.nargs('all', 0)
|
.nargs('all', 0)
|
||||||
@ -132,7 +137,6 @@ function withAffectedOptions(yargs: yargs.Argv): yargs.Argv {
|
|||||||
default: []
|
default: []
|
||||||
})
|
})
|
||||||
.conflicts({
|
.conflicts({
|
||||||
SHA1: ['files', 'untracked', 'uncommitted', 'base', 'head', 'all'],
|
|
||||||
files: ['uncommitted', 'untracked', 'base', 'head', 'all'],
|
files: ['uncommitted', 'untracked', 'base', 'head', 'all'],
|
||||||
untracked: ['uncommitted', 'files', 'base', 'head', 'all'],
|
untracked: ['uncommitted', 'files', 'base', 'head', 'all'],
|
||||||
uncommitted: ['files', 'untracked', 'base', 'head', 'all'],
|
uncommitted: ['files', 'untracked', 'base', 'head', 'all'],
|
||||||
|
|||||||
@ -65,6 +65,17 @@ export function parseFiles(
|
|||||||
files: getFilesUsingBaseAndHead(base, head),
|
files: getFilesUsingBaseAndHead(base, head),
|
||||||
rest: [...unnamed, ...named]
|
rest: [...unnamed, ...named]
|
||||||
};
|
};
|
||||||
|
} else if (base) {
|
||||||
|
return {
|
||||||
|
files: Array.from(
|
||||||
|
new Set([
|
||||||
|
...getFilesUsingBaseAndHead(base, 'HEAD'),
|
||||||
|
...getUncommittedFiles(),
|
||||||
|
...getUntrackedFiles()
|
||||||
|
])
|
||||||
|
),
|
||||||
|
rest: [...unnamed, ...named]
|
||||||
|
};
|
||||||
} else if (unnamed.length >= 2) {
|
} else if (unnamed.length >= 2) {
|
||||||
return {
|
return {
|
||||||
files: getFilesFromShash(unnamed[0], unnamed[1]),
|
files: getFilesFromShash(unnamed[0], unnamed[1]),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user