When I save a path to the inject variable (save it to the associated file) and then retrieve it, all the the slashes have been stripped.
How do you preserve the slashes when retrieving the injected path?
SciptZipPath: C:\agent\xml-data\build-dir\UT-RPER348-OB1\DBScripts_2023.16.23680.25.zip
when read back in:
C:agent xml-data build-dir UT-RPER348-JOB1DBScripts_2023.16.23680.25.zip
Here is how I am saving the variable in a script task:
$scriptZipPath = Join-Path -Path $bambooWorkingDirectory -ChildPath $archiveName;
$scriptInjectPath = "${bamboo.build.working.directory}\bamboo\archive.properties";
$propertiesFile = New-Item -Path $scriptInjectPath -ItemType "file" -Force;
Add-Content $propertiesFile "zipPath=$scriptZipPath";
Testing reading back in as follows:
Write-Host ${bamboo.inject.zipPath};
Hello @Steve Messer
When exporting the path, make sure to use double backslashes (\\). Bamboo is written in Java and all parsing depends on such language, which will consider two slashes as a single "\" character. If you specify just on backslash, it will be treated as a whitespace or linebreak.
In your case:
SciptZipPath: C:\\agent\\xml-data\\build-dir\\UT-RPER348-OB1\\DBScripts_2023.16.23680.25.zip
Kind regards,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, @Steve Messer make sure to hit the Accept button so this answer can help others.
Cheers,
Eduardo Alvarenga
Atlassian Support APAC
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.