Skip to content
Snippets Groups Projects
Commit 702cfff1 authored by jurgenhaas's avatar jurgenhaas
Browse files

Adjust drush and alias settings for Drush 9 beta8

parent 85a71613
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -120,13 +120,15 @@ class Handler {
$options['webRoot'] = $webRoot . '/';
$orig_ignored = FALSE;
foreach ($this->getFiles($projectRoot, $webRoot, $settingsPath) as $template => $def) {
$file = $def['dest'] . '/' . $template;
$twig_loader->setTemplate($template, $template);
$filename = $twig->render($template, $options);
$file = $def['dest'] . '/' . $filename;
if ($overwrite || !$fs->exists($file)) {
$twig_loader->setTemplate($template, file_get_contents($pluginRoot . '/templates/' . $template . '.twig'));
$rendered = $twig->render($template, $options);
if (!empty($def['add2yaml']) && isset($options[$template])) {
$twig_loader->setTemplate($filename, file_get_contents($pluginRoot . '/templates/' . $template . '.twig'));
$rendered = $twig->render($filename, $options);
if (!empty($def['add2yaml']) && isset($options[$filename])) {
$yaml = Yaml::parse($rendered);
$yaml = array_merge_recursive($yaml, $options[$template]);
$yaml = array_merge_recursive($yaml, $options[$filename]);
$rendered = Yaml::dump($yaml, 9, 2);
}
if ($fs->exists($file)) {
......@@ -144,12 +146,12 @@ class Handler {
}
}
else {
$this->git('ignore ' . $template);
$this->git('ignore ' . $filename);
}
file_put_contents($file, $rendered);
}
if (isset($def['link']) && ($def['link'] != $settingsPath)) {
$link = $def['link'] . '/' . $template;
$link = $def['link'] . '/' . $filename;
if (!$fs->exists($link)) {
$rel = substr($fs->makePathRelative($file, $projectRoot . '/' . $link), 3, -1);
$fs->symlink($rel, $link);
......@@ -188,7 +190,7 @@ class Handler {
'drushrc.php' => [
'dest' => $projectRoot . '/drush',
],
'aliases.yml' => [
'{{ projectname }}.alias.yml' => [
'dest' => $projectRoot . '/drush',
'add2yaml' => TRUE,
],
......
sites:
{{ projectname }}:
dev:
root: '/var/www/html/{{ webRoot }}'
uri: '{{ projectname }}.docker.localhost:8000'
live:
root: '{{ live.root }}'
uri: '{{ live.uri }}'
remote-host: '{{ live.host }}'
remote-user: '{{ live.user }}'
drush:
paths:
include:
- './drush/contrib'
options:
uri: 'http://{{ projectname }}.docker.localhost:8000'
command:
......
dev:
root: '/var/www/html/{{ webRoot }}'
uri: '{{ projectname }}.docker.localhost:8000'
live:
root: '{{ live.root }}'
uri: '{{ live.uri }}'
host: '{{ live.host }}'
user: '{{ live.user }}'
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