Bamboo xml autocompleting brokes our build script

Before building C# app with mono compiler we need to change one .sln file: place additional <Reference> tag after exists. On non-production server this can be done via sed:

sed -i 's/&lt;Reference Include="System" \/&gt;/&lt;Reference Include="System" \/&gt; &lt;Reference Include="Mono.Posix" \/&gt;/' Infrastructure.Common/Infrastructure.Common.csproj

But when same code placed in bamboo task script, editor changes it into these strange text:

sed -i 's/&lt;Reference Include="System" \&gt;&lt;/Reference&gt;/&lt;Reference Include="System" \&gt;&lt;/Reference&gt; &lt;Reference Include="Mono.Posix" \&gt;&lt;/Reference&gt;/' Infrastructure.Common/Infrastructure.Common.csproj

As a result, build fails. Is there a way to change it's behavior, or we don't can use sed in build scripts?

1 answer

0 vote

Hello :)

If for some reason when you put your code on bamboo task script it complains about the "/", you could try to create a small script to do the changes on your .sln file and make bamboo call it, as workaround. For example:

#!/bin/bash
sed -i 's/&lt;Reference Include="System" \/&gt;/&lt;Reference Include="System" \/&gt; &lt;Reference Include="Mono.Posix" \/&gt;/' Infrastructure.Common/Infrastructure.Common.csproj

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

25,808 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you