From 21986694c97a76b4e98b9b59f862424bc45d87d9 Mon Sep 17 00:00:00 2001 From: Andrew Maguire Date: Fri, 6 Jan 2023 13:16:46 +0000 Subject: [PATCH 1/4] try multiple folders --- .devcontainer/{ => default}/devcontainer.json | 0 .../{ => default}/post_create_command.sh | 0 .devcontainer/frontend/devcontainer.json | 15 +++++++++++++++ .devcontainer/frontend/post_create_command.sh | 2 ++ 4 files changed, 17 insertions(+) rename .devcontainer/{ => default}/devcontainer.json (100%) rename .devcontainer/{ => default}/post_create_command.sh (100%) create mode 100644 .devcontainer/frontend/devcontainer.json create mode 100644 .devcontainer/frontend/post_create_command.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/default/devcontainer.json similarity index 100% rename from .devcontainer/devcontainer.json rename to .devcontainer/default/devcontainer.json diff --git a/.devcontainer/post_create_command.sh b/.devcontainer/default/post_create_command.sh similarity index 100% rename from .devcontainer/post_create_command.sh rename to .devcontainer/default/post_create_command.sh diff --git a/.devcontainer/frontend/devcontainer.json b/.devcontainer/frontend/devcontainer.json new file mode 100644 index 00000000..22f43374 --- /dev/null +++ b/.devcontainer/frontend/devcontainer.json @@ -0,0 +1,15 @@ +{ + "name": "Open-Assistant", + "image": "mcr.microsoft.com/vscode/devcontainers/universal", + "features": { + "ghcr.io/devcontainers-contrib/features/pre-commit:2": { + "version": "latest" + } + }, + "postCreateCommand": "bash .devcontainer/post_create_command.sh", + "customizations": { + "vscode": { + "extensions": ["GitHub.copilot"] + } + } +} diff --git a/.devcontainer/frontend/post_create_command.sh b/.devcontainer/frontend/post_create_command.sh new file mode 100644 index 00000000..983576b9 --- /dev/null +++ b/.devcontainer/frontend/post_create_command.sh @@ -0,0 +1,2 @@ +# ensure pre-commit is installed +pre-commit install From cbd99e1ec8f01ed08a0cb602cb60eab6cb51daa1 Mon Sep 17 00:00:00 2001 From: Andrew Maguire Date: Fri, 6 Jan 2023 13:41:46 +0000 Subject: [PATCH 2/4] try subfolder --- .devcontainer/{default => }/devcontainer.json | 0 .devcontainer/frontend/post_create_command.sh | 5 +++++ .devcontainer/{default => }/post_create_command.sh | 0 3 files changed, 5 insertions(+) rename .devcontainer/{default => }/devcontainer.json (100%) rename .devcontainer/{default => }/post_create_command.sh (100%) diff --git a/.devcontainer/default/devcontainer.json b/.devcontainer/devcontainer.json similarity index 100% rename from .devcontainer/default/devcontainer.json rename to .devcontainer/devcontainer.json diff --git a/.devcontainer/frontend/post_create_command.sh b/.devcontainer/frontend/post_create_command.sh index 983576b9..001ea00e 100644 --- a/.devcontainer/frontend/post_create_command.sh +++ b/.devcontainer/frontend/post_create_command.sh @@ -1,2 +1,7 @@ # ensure pre-commit is installed pre-commit install + +# npm install in /website +cd website +npm install +cd .. \ No newline at end of file diff --git a/.devcontainer/default/post_create_command.sh b/.devcontainer/post_create_command.sh similarity index 100% rename from .devcontainer/default/post_create_command.sh rename to .devcontainer/post_create_command.sh From b4cbbe13b0130b9864816fc9c37fa6aeac9ef5c5 Mon Sep 17 00:00:00 2001 From: Andrew Maguire Date: Fri, 6 Jan 2023 13:56:45 +0000 Subject: [PATCH 3/4] add `frontend` devcontainer --- .devcontainer/README.md | 2 ++ .devcontainer/frontend/devcontainer.json | 2 +- .devcontainer/frontend/post_create_command.sh | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index a7e792da..9be25ac7 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -8,6 +8,8 @@ devcontainer (either or in your browser via [GitHub Codespaces](https://github.com/features/codespaces)). +**Note**: If you want to chose a specific .devcontainer within GitHub codespaces select "New with options" and you will be able to select any of the pre-defined devcontainers in this repo. + ### Run pre-commit ```bash diff --git a/.devcontainer/frontend/devcontainer.json b/.devcontainer/frontend/devcontainer.json index 22f43374..4f3c61ce 100644 --- a/.devcontainer/frontend/devcontainer.json +++ b/.devcontainer/frontend/devcontainer.json @@ -6,7 +6,7 @@ "version": "latest" } }, - "postCreateCommand": "bash .devcontainer/post_create_command.sh", + "postCreateCommand": "bash .devcontainer/frontend/post_create_command.sh", "customizations": { "vscode": { "extensions": ["GitHub.copilot"] diff --git a/.devcontainer/frontend/post_create_command.sh b/.devcontainer/frontend/post_create_command.sh index 001ea00e..2e5af4e3 100644 --- a/.devcontainer/frontend/post_create_command.sh +++ b/.devcontainer/frontend/post_create_command.sh @@ -4,4 +4,4 @@ pre-commit install # npm install in /website cd website npm install -cd .. \ No newline at end of file +cd .. From c0b2676d7961d2fa3ee23ac7291f1a191d92b732 Mon Sep 17 00:00:00 2001 From: Andrew Maguire Date: Fri, 6 Jan 2023 14:02:19 +0000 Subject: [PATCH 4/4] fix pre-commit --- .devcontainer/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index 9be25ac7..c93a9660 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -8,7 +8,9 @@ devcontainer (either or in your browser via [GitHub Codespaces](https://github.com/features/codespaces)). -**Note**: If you want to chose a specific .devcontainer within GitHub codespaces select "New with options" and you will be able to select any of the pre-defined devcontainers in this repo. +**Note**: If you want to chose a specific .devcontainer within GitHub codespaces +select "New with options" and you will be able to select any of the pre-defined +devcontainers in this repo. ### Run pre-commit