Skip to content

Commit

Permalink
[ci skip] improve codespace support
Browse files Browse the repository at this point in the history
  • Loading branch information
zeriyoshi committed Aug 22, 2024
1 parent 2db5cad commit 8f475ad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
8 changes: 2 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Pskel",
"name": "Pskel (for Codespaces)",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -12,9 +12,5 @@
}
},
"dockerComposeFile": "./../compose.yaml",
"service": "shell",
"workspaceFolder": "/pskel",
"mounts": [
"source=${localWorkspaceFolder},target=/pskel,type=bind,consistency=cached"
]
"service": "shell"
}
20 changes: 20 additions & 0 deletions .devcontainer/local/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Pskel (for Local)",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"maelvalais.autoconf",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig"
]
}
},
"dockerComposeFile": "./../compose.yaml",
"service": "shell",
"workspaceFolder": "/workspaces/pskel",
"mounts": [
"source=${localWorkspaceFolder},target=/workspaces/pskel,type=bind,consistency=cached"
]
}
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,3 @@ RUN docker-php-source extract \

COPY ./patches /patches
COPY ./ext /ext

WORKDIR "/pskel"
18 changes: 12 additions & 6 deletions pskel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ EOF

PSKEL_EXT_DIR="/ext"

if test -d "/pskel/ext"; then
echo "[Pskel] Development containers workspace detected, use \"/pskel/ext\"." >&2
PSKEL_EXT_DIR="/pskel/ext"
if test -d "/workspaces/pskel/ext"; then
echo "[Pskel] Development Containers workspace detected, use \"/workspaces/pskel/ext\"." >&2
PSKEL_EXT_DIR="/workspaces/pskel/ext"
elif test -d "${CODESPACE_VSCODE_FOLDER}"; then
echo "[Pskel] GitHub Codespace workspace detected, use \"${CODESPACE_VSCODE_FOLDER}/ext\"." >&2
PSKEL_EXT_DIR="${CODESPACE_VSCODE_FOLDER}/ext"
fi

/usr/local/bin/php "/usr/src/php/ext/ext_skel.php" --ext "${1}" --dir "/tmp" ${@}
Expand Down Expand Up @@ -90,9 +93,12 @@ EOF

PSKEL_EXT_DIR="/ext"

if test -d "/pskel/ext"; then
echo "[Pskel] Development containers workspace detected, use \"/pskel/ext\"." >&2
PSKEL_EXT_DIR="/pskel/ext"
if test -d "/workspaces/pskel/ext"; then
echo "[Pskel] Development Containers workspace detected, use \"/workspaces/pskel/ext\"." >&2
PSKEL_EXT_DIR="/workspaces/pskel/ext"
elif test -d "${CODESPACE_VSCODE_FOLDER}"; then
echo "[Pskel] GitHub Codespace workspace detected, use \"${CODESPACE_VSCODE_FOLDER}/ext\"." >&2
PSKEL_EXT_DIR="${CODESPACE_VSCODE_FOLDER}/ext"
else
if test -f "/ext/.gitkeep" && test $(cat "/ext/.gitkeep") = "pskel_uninitialized"; then
echo "[Pskel] Uninitialized project detected, initialize default skeleton." >&2
Expand Down

0 comments on commit 8f475ad

Please sign in to comment.