mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
powershell formatting
This commit is contained in:
parent
3859f6ffc0
commit
efb3338f5c
@ -35,7 +35,7 @@
|
||||
.LINK
|
||||
http://cmder.app/ - Project Home
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess=$true)]
|
||||
[CmdletBinding(SupportsShouldProcess = $true)]
|
||||
Param(
|
||||
# CmdletBinding will give us;
|
||||
# -verbose switch to turn on logging and
|
||||
@ -108,12 +108,14 @@ if (-Not $noVendor) {
|
||||
$ConEmuXmlSave = Join-Path $config "ConEmu.xml"
|
||||
Write-Verbose "Backup '$ConEmuXml' to '$ConEmuXmlSave'"
|
||||
Copy-Item $ConEmuXml $ConEmuXmlSave
|
||||
} else { $ConEmuXml = "" }
|
||||
} else { $ConEmuXml = "" }
|
||||
}
|
||||
else { $ConEmuXml = "" }
|
||||
}
|
||||
else { $ConEmuXml = "" }
|
||||
|
||||
# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
|
||||
foreach ($ssh_agent in $(Get-Process ssh-agent -ErrorAction SilentlyContinue)) {
|
||||
if ([string]$($ssh_agent.path) -Match [string]$cmder_root.replace('\','\\')) {
|
||||
if ([string]$($ssh_agent.path) -Match [string]$cmder_root.replace('\', '\\')) {
|
||||
Write-Verbose $("Stopping " + $ssh_agent.path + "!")
|
||||
Stop-Process $ssh_agent.id
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
https://github.com/cmderdev/cmder - Project Home
|
||||
#>
|
||||
|
||||
[CmdletBinding(SupportsShouldProcess=$true)]
|
||||
[CmdletBinding(SupportsShouldProcess = $true)]
|
||||
Param(
|
||||
# CmdletBinding will give us;
|
||||
# -verbose switch to turn on logging and
|
||||
@ -42,8 +42,8 @@ $ErrorActionPreference = "Stop"
|
||||
Ensure-Executable "7z"
|
||||
|
||||
$targets = @{
|
||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on";
|
||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3";
|
||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on";
|
||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3";
|
||||
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`"";
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ $version = Get-VersionStr
|
||||
|
||||
if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) {
|
||||
Write-Verbose "Packing Cmder $version in $saveTo..."
|
||||
$excluded = (Get-Content -Path "$cmderRoot\packignore") -Split [System.Environment]::NewLine | Where-Object {$_}
|
||||
$excluded = (Get-Content -Path "$cmderRoot\packignore") -Split [System.Environment]::NewLine | Where-Object { $_ }
|
||||
Get-ChildItem $cmderRoot -Force -Exclude $excluded
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
.LINK
|
||||
http://cmder.app/ - Project Home
|
||||
#>
|
||||
[CmdletBinding(SupportsShouldProcess=$true)]
|
||||
[CmdletBinding(SupportsShouldProcess = $true)]
|
||||
Param(
|
||||
# CmdletBinding will give us;
|
||||
# -verbose switch to turn on logging and
|
||||
@ -158,10 +158,10 @@ function Fetch-DownloadUrl {
|
||||
|
||||
# Special case for archive downloads of repository
|
||||
if (($null -eq $downloadLinks) -Or (-Not $downloadLinks)) {
|
||||
if ((($p | % {$_.Trim('/')}) -Contains "archive") -And $info[0].tag_name) {
|
||||
if ((($p | % { $_.Trim('/') }) -Contains "archive") -And $info[0].tag_name) {
|
||||
for ($i = 0; $i -lt $p.Length; $i++) {
|
||||
if ($p[$i].Trim('/') -eq "archive") {
|
||||
$p[$i+1] = $info[0].tag_name + ".zip"
|
||||
$p[$i + 1] = $info[0].tag_name + ".zip"
|
||||
$downloadLinks = $url.Scheme + "://" + $url.Host + ($p -Join '')
|
||||
return $downloadLinks
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user