Skip to content

Commit e6805b9

Browse files
Rework replacement function for installer to use the same pattern like windows (actions#22)
* rework replacement function to use the same pattern like windows * remove old replacement
1 parent c0e7ef2 commit e6805b9

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

azure-pipelines/run-ci-builds.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
pool:
1414
name: Azure Pipelines
1515
vmImage: 'ubuntu-latest'
16+
timeoutInMinutes: 180
1617

1718
steps:
1819
- checkout: self

builders/nix-python-builder.psm1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,14 @@ class NixPythonBuilder : PythonBuilder {
9393
$installationTemplateLocation = Join-Path -Path $this.InstallationTemplatesLocation -ChildPath $this.InstallationTemplateName
9494

9595
$installationTemplateContent = Get-Content -Path $installationTemplateLocation -Raw
96-
$installationTemplateContent = $installationTemplateContent -f $this.Version.Major, $this.Version.Minor, $this.Version.Build
96+
97+
$variablesToReplace = @{
98+
"{{__VERSION_MAJOR__}}" = $this.Version.Major;
99+
"{{__VERSION_MINOR__}}" = $this.Version.Minor;
100+
"{{__VERSION_BUILD__}}" = $this.Version.Build;
101+
}
102+
$variablesToReplace.keys | ForEach-Object { $installationTemplateContent = $installationTemplateContent.Replace($_, $variablesToReplace[$_]) }
103+
97104
$installationTemplateContent | Out-File -FilePath $installationScriptLocation
98105

99106
Write-Debug "Done; Installation script location: $installationScriptLocation)"

installers/nix-setup-template.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
set -e
22

3-
MAJOR_VERSION={0}
4-
MINOR_VERSION={1}
5-
BUILD_VERSION={2}
3+
MAJOR_VERSION="{{__VERSION_MAJOR__}}"
4+
MINOR_VERSION="{{__VERSION_MINOR__}}"
5+
BUILD_VERSION="{{__VERSION_BUILD__}}"
66

77
PYTHON_MAJOR=python$MAJOR_VERSION
88
PYTHON_MAJOR_DOT_MINOR=python$MAJOR_VERSION.$MINOR_VERSION

0 commit comments

Comments
 (0)