8000 Remove "Before" from Write-StatusPowerLine · PoshCode/PSGit@b971ac2 · GitHub
[go: up one dir, main page]

Skip to content

Commit b971ac2

Browse files
committed
Remove "Before" from Write-StatusPowerLine
Remove background colors from default configuration.
1 parent 8035dd0 commit b971ac2

File tree

6 files changed

+492
-476
lines changed

6 files changed

+492
-476
lines changed

Build.ps1

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,34 @@ function clean {
9999
[Switch]$Packages
100100
)
101101

102+
$DeleteMe = Join-Path $Env:Temp "Delete This Folder"
103+
104+
while(Test-Path $DeleteMe -PathType Leaf) {
105+
$DeleteMe = $DeleteMe + "!"
106+
}
107+
108+
if(Test-Path $DeleteMe -PathType Container) {
109+
Remove-Item $DeleteMe -Recurse -Force -ErrorAction SilentlyContinue
110+
}
111+
$DeleteMe = Join-Path $DeleteMe ([Guid]::NewGuid().Guid)
112+
$null = New-Item $DeleteMe -Type Directory -Force
113+
102114
Trace-Message "OUTPUT Release Path: $ReleasePath"
103115
if(Test-Path $ReleasePath) {
104116
Trace-Message " Clean up old build"
105-
Trace-Message "DELETE $ReleasePath\"
106-
Remove-Item $ReleasePath -Recurse -Force -ErrorAction Continue
117+
Trace-Message "REMOVE $ReleasePath\"
118+
Push-Location $ReleasePath
119+
foreach($file in Get-ChildItem $ReleasePath -Recurse | Where-Object { !$_.PSIsContainer }) {
120+
$RelPath = Resolve-Path $file.FullName -Relative | Split-Path
121+
$Destination = Join-Path $DeleteMe $RelPath
122+
$Destination = (New-Item $Destination -Type Directory -Force).FullName
123+
Trace-Message "(re)move $RelPath to $Destination"
124+
Move-Item $file.FullName -Force -Destination $Destination
125+
}
126+
Pop-Location
127+
Remove-Item $ReleasePath -Force -Recurse
107128
}
129+
108130
if(Test-Path $Path\packages) {
109131
Trace-Message "DELETE $Path\packages"
110132
# force reinstall by cleaning the old ones
@@ -165,7 +187,7 @@ function update {
165187
foreach($manifest in Get-ChildItem $Script:SourcePath -filter *.psd1 -Recurse) {
166188
foreach($Dependency in (Get-Module $manifest.FullName -ListAvailable -ErrorAction SilentlyContinue).RequiredModules) {
167189
if(!(Get-Module $Dependency.Name -ListAvailable -EA 0)) {
168-
Install-Module -Name $Dependency.Name -AllowClobber -Force -SkipPublisherCheck
190+
Install-Module -Name $Dependency.Name -AllowClobber -Force -SkipPublisherCheck -Scope CurrentUser
169191
}
170192
}
171193
}
@@ -302,18 +324,18 @@ function test {
302324
Set-Content "$TestPath\.Do.Not.COMMIT.This.Steps.ps1" "Import-Module $ReleasePath\${ModuleName}.psd1 -Force"
303325

304326
# Show the commands they would have to run to get these results:
305-
Write-Host $(prompt) -NoNewLine
327+
Write-Host "C:\PS> " -NoNewLine
306328
Write-Host Import-Module $ReleasePath\${ModuleName}.psd1 -Force
307-
Write-Host $(prompt) -NoNewLine
329+
Write-Host "C:\PS> " -NoNewLine
308330

309331
# TODO: Update dependency to Pester 4.0 and use just Invoke-Pester
310332
if(Get-Command Invoke-Gherkin -ErrorAction SilentlyContinue) {
311333
Write-Host Invoke-Gherkin -Path $TestPath -CodeCoverage "$ReleasePath\*.psm1" -PassThru @Options
312334
$TestResults = Invoke-Gherkin -Path $TestPath -CodeCoverage "$ReleasePath\*.psm1" -PassThru @Options
313335
}
314336

315-
# Write-Host Invoke-Pester -Path $TestPath -CodeCoverage "$ReleasePath\*.psm1" -PassThru @Options
316-
# $TestResults = Invoke-Pester -Path $TestPath -CodeCoverage "$ReleasePath\*.psm1" -PassThru @Options
337+
Write-Host Invoke-Pester -Path $TestPath -CodeCoverage "$ReleasePath\*.psm1" -PassThru @Options
338+
$TestResults = Invoke-Pester -Path $TestPath -CodeCoverage "$ReleasePath\*.psm1" -PassThru @Options
317339

318340
Remove-Module $ModuleName -ErrorAction SilentlyContinue
319341
Remove-Item "$TestPath\.Do.Not.COMMIT.This.Steps.ps1"

0 commit comments

Comments
 (0)
0