Use switch for enabling git changes. Add help messages to parameters.

This commit is contained in:
Arlo Godfrey 2022-04-11 17:56:04 -05:00
Родитель 4032dd9fa5
Коммит 98a66c3b92
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -1,9 +1,13 @@
Param (
[ValidateSet('all', 'wasm', 'uwp', 'winappsdk', 'wpf', 'gtk', 'macos', 'ios', 'droid')]
[string[]]$targets
[Parameter(HelpMessage = "The target frameworks to enable.")]
[ValidateSet('all', 'wasm', 'uwp', 'winappsdk', 'wpf', 'gtk', 'macos', 'ios', 'droid')]
[string[]]$targets,
[Parameter(HelpMessage = "Disables suppressing changes to the Labs.TargetFrameworks.props file in git, allowing changes to be committed.")]
[switch]$allowGitChanges = $false
)
if ($args.Contains("--allow-git-changes")) {
if ($allowGitChanges.IsPresent) {
Write-Warning "Changes to the default TargetFrameworks in Labs can now be committed. Run this command again without the --allow-git-changes flag to disable committing further changes.";
git update-index --no-assume-unchanged ../Labs.TargetFrameworks.props
}