Ensure casper theme is always in content directory#26
Ensure casper theme is always in content directory#26adam-beck wants to merge 1 commit intodocker-library:masterfrom adam-beck:master
Conversation
|
Ah, this is an unpleasant side effect of #8. 😞 I'm not thrilled about the idea of hard-coding diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 24c8e45..ec7842f 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -2,8 +2,9 @@
set -e
if [[ "$*" == npm*start* ]]; then
- for dir in "$GHOST_SOURCE/content"/*/; do
- targetDir="$GHOST_CONTENT/$(basename "$dir")"
+ baseDir="$GHOST_SOURCE/content"
+ for dir in "$baseDir"/*/ "$baseDir"/themes/*/; do
+ targetDir="$GHOST_CONTENT/${dir#$baseDir/}"
mkdir -p "$targetDir"
if [ -z "$(ls -A "$targetDir")" ]; then
tar -c --one-file-system -C "$dir" . | tar xC "$targetDir" |
|
I'll take a look at this. I'm not 100% sure that Ghost has the expectation that the Casper theme is present. Maybe there is an environment variable or configuration setting that allows you to supply a default theme on startup. |
|
It looks like the database would need to be modified to tell Ghost which theme to start with. I don't think that would be a wise decision. So I will take another look at the code comments you made. @tianon Although I still don't understand why this approach I suggested isn't viable. Without casper, Ghost will break. I think it makes sense to directly copy that in. |
|
@tianon I don't see any other way around hardcoding the copying of the casper theme into the |
|
Any other suggestions to get this moving? |
|
@adam-beck the patch I posted is essentially just a more generic version of your patch (such that if the pre-supplied theme name ever changes, the script will not need to be updated) |
When working on an individual theme, simply mounting the
/var/lib/ghost/themes/$THEME_NAMEdirectory will not suffice. Casper needs to be in this directory for Ghost to start so it only makes sense that it is guaranteed to be there.