Skip to content
Snippets Groups Projects
Commit 5c93924b authored by jurgenhaas's avatar jurgenhaas
Browse files

Add mechanism to interact with extra|l3d in composer.json when starting l3d

parent 8e326153
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ ENV LAKEDROPS_DEV_DC_OPTIONS " "
ADD config.fish /etc/fish/
ADD start.sh /usr/local/bin/.start
ADD configIdea.sh /usr/local/bin/.configIdea
ADD l3dComposer.php /usr/local/bin/.l3dComposer.php
RUN echo "Install dorgflow" && \
cd /var/opt && \
......
<?php
function loadEarly($items) {
foreach ($items as $path => $source) {
if (!file_exists($path)) {
if (!mkdir($path, 0777, TRUE) || !is_dir($path)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
}
exec('git clone ' . $source . ' ' . $path);
}
}
}
print("a1");
if (file_exists('composer.json')) {
print("a2");
$composer = json_decode(file_get_contents('composer.json'), TRUE);
print("a2n");
if (isset($composer['extra']['l3d'])) {
print("a3");
foreach ($composer['extra']['l3d'] as $type => $args) {
print("a4: " . $type);
if ($type === 'load-early') {
loadEarly($args);
}
}
}
}
#!/bin/bash
function l3dComposer {
php /usr/local/bin/.l3dComposer.php
}
function readEnv {
if [[ -f ".env" ]]; then
# shellcheck disable=SC2046
......@@ -38,6 +42,7 @@ function create {
else
composer create-project "${PROJECT}" ./ --no-interaction
fi
l3dComposer
restoreEnvFile
if [[ -f "docker-compose.yml" ]]; then
......@@ -89,6 +94,7 @@ function create {
function clone {
truncateCurrentDirectory
git clone "${REPOSITORY}" .
l3dComposer
composer update
restoreEnvFile
}
......@@ -111,6 +117,7 @@ function initialSetup {
case ${OPTION} in
0 )
restoreEnvFile
l3dComposer
break
;;
......@@ -161,6 +168,8 @@ if [[ -z "$EXISTING" ]]; then
else
initialSetup
fi
else
l3dComposer
fi
if [[ -d /drupal/.idea ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment