Skip to content

Commit

Permalink
chore: improve container config & shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed May 29, 2024
1 parent c604b5f commit 04f5e77
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "Jekyll",
"image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye",
"runArgs": ["--name", "${containerWorkspaceFolderBasename}"],
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "latest"
}
},
"postCreateCommand": "npm i",
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"postStartCommand": "npm i",
"customizations": {
"vscode": {
"settings": {
Expand Down Expand Up @@ -42,7 +44,8 @@
"esbenp.prettier-vscode",
"foxundermoon.shell-format",
"stylelint.vscode-stylelint",
"yzhang.markdown-all-in-one"
"yzhang.markdown-all-in-one",
"mhutchie.git-graph"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf
tools/* text eol=lf

# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
Expand Down
6 changes: 6 additions & 0 deletions tools/run
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@ if $prod; then
command="JEKYLL_ENV=production $command"
fi

if [ -e /proc/1/cgroup ]; then
if grep -q docker /proc/1/cgroup; then
command="$command --force_polling"
fi
fi

echo -e "\n> $command\n"
eval "$command"

0 comments on commit 04f5e77

Please sign in to comment.