mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 17:59:11 +08:00
add version string handler
This commit is contained in:
parent
f8359fc3f7
commit
018bf45df4
@ -75,9 +75,10 @@ function Get-Version-Str($file) {
|
|||||||
|
|
||||||
function Create-RC($version, $path) {
|
function Create-RC($version, $path) {
|
||||||
|
|
||||||
|
$string = $version
|
||||||
|
|
||||||
if ( !(Test-Path "$path.sample") ) {
|
if ( !(Test-Path "$path.sample") ) {
|
||||||
Write-Error "Invalid path provided for resources file."
|
throw "Invalid path provided for resources file."
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource = Get-Content -Path "$path.sample"
|
$resource = Get-Content -Path "$path.sample"
|
||||||
@ -94,6 +95,9 @@ function Create-RC($version, $path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add the version string
|
||||||
|
$resource = $resource.Replace( "{Cmder-Version-Str}", $string )
|
||||||
|
|
||||||
# Write the results
|
# Write the results
|
||||||
Set-Content -Path $path -Value $resource
|
Set-Content -Path $path -Value $resource
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user