Skip to content

Commit

Permalink
Basic devcontainer (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho authored Mar 12, 2024
1 parent 58fa510 commit cd603d5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "C# (.NET)",
"image": "mcr.microsoft.com/devcontainers/dotnet:1-7.0-jammy",
"onCreateCommand": "./scripts/load_submodule.sh",
"postCreateCommand": "dotnet restore && dotnet build",
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit"
]
}
}
}
12 changes: 12 additions & 0 deletions scripts/load_submodule.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Check if the current directory is a git repository
if [ ! -d ".git" ]; then
echo "Error: This script must be run from the root of a Git repository."
exit 1
fi

# Initialize and update git submodules
git submodule update --init --recursive

echo "Git submodules have been updated."

0 comments on commit cd603d5

Please sign in to comment.