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 32ccca9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"dockerComposeFile": "./../compose.yaml",
"service": "shell",
"workspaceFolder": "/pskel",
"workspaceFolder": ".",
"mounts": [
"source=${localWorkspaceFolder},target=/pskel,type=bind,consistency=cached"
"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 32ccca9

Please sign in to comment.