mirror of
https://github.com/actions/python-versions.git
synced 2025-04-07 07:49:41 +00:00
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:
@ -13,6 +13,7 @@ jobs:
|
|||||||
pool:
|
pool:
|
||||||
name: Azure Pipelines
|
name: Azure Pipelines
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
timeoutInMinutes: 180
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
|
@ -93,7 +93,14 @@ class NixPythonBuilder : PythonBuilder {
|
|||||||
$installationTemplateLocation = Join-Path -Path $this.InstallationTemplatesLocation -ChildPath $this.InstallationTemplateName
|
$installationTemplateLocation = Join-Path -Path $this.InstallationTemplatesLocation -ChildPath $this.InstallationTemplateName
|
||||||
|
|
||||||
$installationTemplateContent = Get-Content -Path $installationTemplateLocation -Raw
|
$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
|
$installationTemplateContent | Out-File -FilePath $installationScriptLocation
|
||||||
|
|
||||||
Write-Debug "Done; Installation script location: $installationScriptLocation)"
|
Write-Debug "Done; Installation script location: $installationScriptLocation)"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
MAJOR_VERSION={0}
|
MAJOR_VERSION="{{__VERSION_MAJOR__}}"
|
||||||
MINOR_VERSION={1}
|
MINOR_VERSION="{{__VERSION_MINOR__}}"
|
||||||
BUILD_VERSION={2}
|
BUILD_VERSION="{{__VERSION_BUILD__}}"
|
||||||
|
|
||||||
PYTHON_MAJOR=python$MAJOR_VERSION
|
PYTHON_MAJOR=python$MAJOR_VERSION
|
||||||
PYTHON_MAJOR_DOT_MINOR=python$MAJOR_VERSION.$MINOR_VERSION
|
PYTHON_MAJOR_DOT_MINOR=python$MAJOR_VERSION.$MINOR_VERSION
|
||||||
|
Reference in New Issue
Block a user