Replaced -GitClone with -NoGitClone

Esse commit está contido em:
lksz 2020-10-02 14:13:33 -04:00
commit c25de685c1
1 arquivos alterados com 5 adições e 5 exclusões

Ver arquivo

@ -3,7 +3,7 @@
[switch]$RemoveOnly,
[switch]$ShowSkipped,
[switch]$Force,
[switch]$GitClone,
[switch]$NoGitClone,
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
[Parameter(DontShow)]
[string]$MyPSScriptRoot = $MyPSScriptRoot
@ -15,7 +15,7 @@ function _Setup {
[switch]$RemoveOnly,
[switch]$ShowSkipped,
[switch]$Force,
[switch]$GitClone,
[switch]$NoGitClone,
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
[Parameter(DontShow)]
[string]$MyPSScriptRoot = $MyPSScriptRoot)
@ -40,9 +40,9 @@ Get-Command Reload-MyScripts -ErrorAction SilentlyContinue | ForEach-Object { .
## _Setup Logic starts here
#######################################################################
if ( $GitClone -and -not (Test-Path $(Join-Path $MyPSScriptRoot '.git')) ) {
if ( -not $NoGitClone -and -not (Test-Path $(Join-Path $MyPSScriptRoot '.git')) ) {
if ( -not [bool]$(Get-Command git -ErrorAction SilentlyContinue) ) {
throw "No git command found, you may either omit the -GitClone switch or install git and try again."
throw "No git command found, you may either omit run with the -NoGitClone switch or install git and try again."
}
if ( $PSCmdlet.ShouldProcess("Pull git repo from $GitURL into $MyPSScriptRoot ?") ) {
Push-Location $MyPSScriptRoot
@ -59,7 +59,7 @@ Get-Command Reload-MyScripts -ErrorAction SilentlyContinue | ForEach-Object { .
$GitOutput = "$(& git checkout --force)"
Write-Verbose $GitOutput
Pop-Location
Write-Verbose "-GitClone step done."
Write-Verbose "Git clone done."
}
}