Skip to content

Commit cd603d5

Browse files
authored
Basic devcontainer (#886)
1 parent 58fa510 commit cd603d5

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.devcontainer/devcontainer.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
3+
{
4+
"name": "C# (.NET)",
5+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-7.0-jammy",
6+
"onCreateCommand": "./scripts/load_submodule.sh",
7+
"postCreateCommand": "dotnet restore && dotnet build",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"ms-dotnettools.csdevkit"
12+
]
13+
}
14+
}
15+
}

scripts/load_submodule.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
# Check if the current directory is a git repository
4+
if [ ! -d ".git" ]; then
5+
echo "Error: This script must be run from the root of a Git repository."
6+
exit 1
7+
fi
8+
9+
# Initialize and update git submodules
10+
git submodule update --init --recursive
11+
12+
echo "Git submodules have been updated."

0 commit comments

Comments
 (0)