mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 09:22:15 +08:00 
			
		
		
		
	trim trailing spaces
This commit is contained in:
		| @@ -66,33 +66,26 @@ function Digest-Hash($path) { | |||||||
| } | } | ||||||
|  |  | ||||||
| function Get-VersionStr() { | function Get-VersionStr() { | ||||||
|  |  | ||||||
|     # Clear existing variable |     # Clear existing variable | ||||||
|     if ($string) { Clear-Variable -name string } |     if ($string) { Clear-Variable -name string } | ||||||
|  |  | ||||||
|     # Determine if git is available |     # Determine if git is available | ||||||
|     if (Get-Command "git.exe" -ErrorAction SilentlyContinue) |     if (Get-Command "git.exe" -ErrorAction SilentlyContinue) { | ||||||
|     { |  | ||||||
|  |  | ||||||
|         # Determine if the current diesctory is a git repository |         # Determine if the current diesctory is a git repository | ||||||
|         $GitPresent = Invoke-Expression "git rev-parse --is-inside-work-tree" -erroraction SilentlyContinue |         $GitPresent = Invoke-Expression "git rev-parse --is-inside-work-tree" -erroraction SilentlyContinue | ||||||
|  |  | ||||||
|         if ( $GitPresent -eq 'true' ) |         if ( $GitPresent -eq 'true' ) { | ||||||
|         { |  | ||||||
|             $string = Invoke-Expression "git describe --abbrev=0 --tags" |             $string = Invoke-Expression "git describe --abbrev=0 --tags" | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     # Fallback used when Git is not available |     # Fallback used when Git is not available | ||||||
|     if ( -not($string) ) |     if ( -not($string) ) { | ||||||
|     { |  | ||||||
|         $string = Parse-Changelog ($PSScriptRoot + '\..\' + 'CHANGELOG.md') |         $string = Parse-Changelog ($PSScriptRoot + '\..\' + 'CHANGELOG.md') | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     # Add build number, if AppVeyor is present |     # Add build number, if AppVeyor is present | ||||||
|     if ( $Env:APPVEYOR -eq 'True' ) |     if ( $Env:APPVEYOR -eq 'True' ) { | ||||||
|     { |  | ||||||
|         $string = $string + '.' + $Env:APPVEYOR_BUILD_NUMBER |         $string = $string + '.' + $Env:APPVEYOR_BUILD_NUMBER | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -100,11 +93,9 @@ function Get-VersionStr() { | |||||||
|     $string = $string -replace '^v+','' # normalize version string |     $string = $string -replace '^v+','' # normalize version string | ||||||
|  |  | ||||||
|     return $string |     return $string | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| function Parse-Changelog($file) { | function Parse-Changelog($file) { | ||||||
|  |  | ||||||
|     # Define the regular expression to match the version string from changelog |     # Define the regular expression to match the version string from changelog | ||||||
|     [regex]$regex = '^## \[(?<version>[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$'; |     [regex]$regex = '^## \[(?<version>[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$'; | ||||||
|  |  | ||||||
| @@ -115,7 +106,6 @@ function Parse-Changelog($file) { | |||||||
| } | } | ||||||
|  |  | ||||||
| function Create-RC($string, $path) { | function Create-RC($string, $path) { | ||||||
|  |  | ||||||
|     $version  = $string + '.0.0.0.0' # padding for version string |     $version  = $string + '.0.0.0.0' # padding for version string | ||||||
|  |  | ||||||
|     if ( !(Test-Path "$path.sample") ) { |     if ( !(Test-Path "$path.sample") ) { | ||||||
| @@ -141,7 +131,6 @@ function Create-RC($string, $path) { | |||||||
|  |  | ||||||
|     # Write the results |     # Write the results | ||||||
|     Set-Content -Path $path -Value $resource |     Set-Content -Path $path -Value $resource | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| function Register-Cmder() { | function Register-Cmder() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user