Rework replacement function for installer to use the same pattern like windows (#22)

* rework replacement function to use the same pattern like windows

* remove old replacement
This commit is contained in:
Maxim Lobanov 2020-05-05 09:44:58 +03:00 committed by GitHub
parent c0e7ef2c3c
commit e6805b9e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -13,6 +13,7 @@ jobs:
pool:
name: Azure Pipelines
vmImage: 'ubuntu-latest'
timeoutInMinutes: 180
steps:
- checkout: self

View File

@ -93,7 +93,14 @@ class NixPythonBuilder : PythonBuilder {
$installationTemplateLocation = Join-Path -Path $this.InstallationTemplatesLocation -ChildPath $this.InstallationTemplateName
$installationTemplateContent = Get-Content -Path $installationTemplateLocation -Raw
$installationTemplateContent = $installationTemplateContent -f $this.Version.Major, $this.Version.Minor, $this.Version.Build
$variablesToReplace = @{
"{{__VERSION_MAJOR__}}" = $this.Version.Major;
"{{__VERSION_MINOR__}}" = $this.Version.Minor;
"{{__VERSION_BUILD__}}" = $this.Version.Build;
}
$variablesToReplace.keys | ForEach-Object { $installationTemplateContent = $installationTemplateContent.Replace($_, $variablesToReplace[$_]) }
$installationTemplateContent | Out-File -FilePath $installationScriptLocation
Write-Debug "Done; Installation script location: $installationScriptLocation)"

View File

@ -1,8 +1,8 @@
set -e
MAJOR_VERSION={0}
MINOR_VERSION={1}
BUILD_VERSION={2}
MAJOR_VERSION="{{__VERSION_MAJOR__}}"
MINOR_VERSION="{{__VERSION_MINOR__}}"
BUILD_VERSION="{{__VERSION_BUILD__}}"
PYTHON_MAJOR=python$MAJOR_VERSION
PYTHON_MAJOR_DOT_MINOR=python$MAJOR_VERSION.$MINOR_VERSION