Skip to content

Commit

Permalink
Merge pull request #85 from michalbachowski/feat/add-injections-suppo…
Browse files Browse the repository at this point in the history
…rt-to-copier

Add injections support to copier
  • Loading branch information
koralowiec authored Dec 17, 2024
2 parents f386664 + ba70d75 commit d4306dc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/copier/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "copier",
"version": "7.0.13",
"version": "7.0.14",
"name": "copier (via pipx)",
"documentationURL": "http://github.com/devcontainers-extra/features/tree/main/src/copier",
"description": "copier creates projects from project templates.",
Expand All @@ -12,6 +12,11 @@
"latest"
],
"type": "string"
},
"injections": {
"default": "",
"description": "Space delimitered list of python packages to inject into the main package env.",
"type": "string"
}
},
"installsAfter": [
Expand Down
7 changes: 3 additions & 4 deletions src/copier/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ set -e
# of the script
ensure_nanolayer nanolayer_location "v0.5.0"


$nanolayer_location \
install \
devcontainer-feature \
"ghcr.io/devcontainers-extra/features/pipx-package:1.1.8" \
--option package='copier' --option version="$VERSION"


--option package='copier' \
--option version="$VERSION" \
--option injections="$INJECTIONS"

echo 'Done!'

10 changes: 10 additions & 0 deletions test/copier/injections.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -e

source dev-container-features-test-lib

check "copier --version" copier --version
check "copier has jinja2-strcase extension available" bash -c 'find $(dirname $(dirname $(which copier))) -name "jinja2_strcase" | grep jinja2_strcase'

reportResults
8 changes: 8 additions & 0 deletions test/copier/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
"features": {
"copier": {}
}
},
"injections": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
"features": {
"copier": {
"injections": "jinja2-strcase"
}
}
}
}

0 comments on commit d4306dc

Please sign in to comment.