From 6de71f133a258da9e69776cc214e2f3bbbf28fc8 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Wed, 8 Nov 2023 13:05:51 +0100 Subject: [PATCH] add architecture to installer script (#91) --- builders/nix-go-builder.psm1 | 2 +- installers/nix-setup-template.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/builders/nix-go-builder.psm1 b/builders/nix-go-builder.psm1 index db626e4..71a4a60 100644 --- a/builders/nix-go-builder.psm1 +++ b/builders/nix-go-builder.psm1 @@ -44,7 +44,7 @@ class NixGoBuilder : GoBuilder { $installationTemplateLocation = Join-Path -Path $this.InstallationTemplatesLocation -ChildPath $this.InstallationTemplateName $installationTemplateContent = Get-Content -Path $installationTemplateLocation -Raw - $installationTemplateContent = $installationTemplateContent -f $this.Version.ToString(3) + $installationTemplateContent = $installationTemplateContent -f $this.Version.ToString(3), $this.Architecture $installationTemplateContent | Out-File -FilePath $installationScriptLocation Write-Debug "Done; Installation script location: $installationScriptLocation)" diff --git a/installers/nix-setup-template.sh b/installers/nix-setup-template.sh index 8d210df..1f5d5dd 100644 --- a/installers/nix-setup-template.sh +++ b/installers/nix-setup-template.sh @@ -1,10 +1,11 @@ set -e GO_VERSION={0} +ARCH={1} GO_TOOLCACHE_PATH=$AGENT_TOOLSDIRECTORY/go GO_TOOLCACHE_VERSION_PATH=$GO_TOOLCACHE_PATH/$GO_VERSION -GO_TOOLCACHE_VERSION_ARCH_PATH=$GO_TOOLCACHE_VERSION_PATH/x64 +GO_TOOLCACHE_VERSION_ARCH_PATH=$GO_TOOLCACHE_VERSION_PATH/$ARCH echo "Check if Go hostedtoolcache folder exist..." if [ ! -d $GO_TOOLCACHE_PATH ]; then @@ -22,4 +23,4 @@ cp -R ./* $GO_TOOLCACHE_VERSION_ARCH_PATH rm $GO_TOOLCACHE_VERSION_ARCH_PATH/setup.sh echo "Create complete file" -touch $GO_TOOLCACHE_VERSION_PATH/x64.complete +touch $GO_TOOLCACHE_VERSION_PATH/$ARCH.complete