Skip to content

Commit

Permalink
added Hugo Homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
Legonois committed Oct 22, 2024
1 parent 3ba8745 commit 09b37fe
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 95 deletions.
21 changes: 0 additions & 21 deletions src/color/devcontainer-feature.json

This file was deleted.

File renamed without changes.
10 changes: 10 additions & 0 deletions src/hugo-homebrew/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Hugo (via Homebrew)",
"id": "hugo-homebrew",
"version": "1.0.0",
"description": "Installs Hugo via Homebrew. Includes the extended version.",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers-extra/features/wget-homebrew"
]
}
18 changes: 9 additions & 9 deletions src/color/install.sh → src/hugo-homebrew/install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/sh
set -e

echo "Activating feature 'color'"
echo "The provided favorite color is: ${FAVORITE}"

echo "Activating feature 'Hugo (Via Homebrew)'"

# The 'install.sh' entrypoint script is always executed as the root user.
#
Expand All @@ -17,10 +15,12 @@ echo "The effective dev container remoteUser's home directory is '$_REMOTE_USER_
echo "The effective dev container containerUser is '$_CONTAINER_USER'"
echo "The effective dev container containerUser's home directory is '$_CONTAINER_USER_HOME'"

cat > /usr/local/bin/color \
<< EOF
#!/bin/sh
echo "my favorite color is ${FAVORITE}"
EOF
if command -v brew >/dev/null 2>&1; then
echo "Homebrew is installed."
else
echo "Homebrew is not installed. Please install Homebrew first."
echo "Example feature: ghcr.io/devcontainers-extra/features/wget-homebrew"
exit 1
fi

chmod +x /usr/local/bin/color
brew install Hugo
31 changes: 0 additions & 31 deletions test/color/my_favorite_color_is_green.sh

This file was deleted.

33 changes: 0 additions & 33 deletions test/color/scenarios.json

This file was deleted.

18 changes: 18 additions & 0 deletions test/hugo-homebrew/scenarios.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"with_brew": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/common-utils:1": {
"upgradePackages": true
},
"ghcr.io/devcontainers-extra/features/wget-homebrew:1": {},
"hugo-homebrew": {}
}
},
"without_brew": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"hugo-homebrew": {}
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion test/color/gold.sh → test/hugo-homebrew/with_brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source dev-container-features-test-lib

# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib.
check "execute command" bash -c "color | grep 'my favorite color is gold'"
check "execute command" bash -c "hugo help | grep 'Hugo is a Fast and Flexible Static Site Generator'"

# Report result
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down
File renamed without changes.

0 comments on commit 09b37fe

Please sign in to comment.