Skip to content

Commit 43b94c5

Browse files
Improve devcontainer setup script with better error handling and fallback
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
1 parent 68e7588 commit 43b94c5

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

.devcontainer/setup.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if [ -z "$NUGET_AUTH_TOKEN" ]; then
2222
else
2323
echo "✅ Azure DevOps PAT token found - configuring private NuGet feed..."
2424

25+
# Remove existing source if it exists, then add with authentication
26+
dotnet nuget remove source "EssentialCSharp" --configfile nuget.config 2>/dev/null || true
27+
2528
# Configure Azure DevOps NuGet source with authentication
2629
dotnet nuget add source "https://pkgs.dev.azure.com/intelliTect/_packaging/EssentialCSharp/nuget/v3/index.json" \
2730
--name "EssentialCSharp" \
@@ -31,7 +34,14 @@ else
3134
--configfile nuget.config
3235

3336
echo "🔧 Restoring packages with private feed access..."
34-
dotnet restore -p:AccessToNugetFeed=true
37+
if dotnet restore -p:AccessToNugetFeed=true; then
38+
echo "✅ Package restore successful with private feed access!"
39+
else
40+
echo "⚠️ Package restore failed with private feed access."
41+
echo " This might indicate an authentication issue with the Azure DevOps PAT token."
42+
echo " Falling back to public packages only..."
43+
dotnet restore -p:AccessToNugetFeed=false
44+
fi
3545
fi
3646

3747
echo "✅ Setup complete!"

nuget.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@
1414
<package pattern="ContentFeedNuget" />
1515
</packageSource>
1616
</packageSourceMapping>
17+
<packageSourceCredentials>
18+
<EssentialCSharp>
19+
<add key="Username" value="devcontainer" />
20+
<add key="ClearTextPassword" value="test-token" />
21+
</EssentialCSharp>
22+
</packageSourceCredentials>
1723
</configuration>

0 commit comments

Comments
 (0)