Skip to content
Snippets Groups Projects
Commit 97dade6e authored by jurgenhaas's avatar jurgenhaas
Browse files

#7 Only include existing assets into gulp file and always run gulp, not only during update

parent 976e2f02
No related branches found
No related tags found
No related merge requests found
......@@ -132,14 +132,16 @@ class Handler
],
], $extra['theme-d8-sass']);
$fs = new Filesystem();
$to = $this->buildInstallationPath($this->options['project_name']);
foreach ($this->options['bower_assets']['fonts'] as $key => $def) {
$package = $this->getPackage('bower-asset/' . $key);
if (!$package) {
$from = $package ? $this->getInstallationManager()->getInstallPath($package) : NULL;
if (!$package || !$fs->exists($from)) {
unset($this->options['bower_assets']['fonts'][$key]);
}
else {
$from = $this->getInstallationManager()->getInstallPath($package);
$converter = new Converter($from, $to);
$this->options['bower_assets']['fonts'][$key]['src'] = $converter->convert($def['src']);
}
......@@ -148,14 +150,14 @@ class Handler
$dependencies = [];
foreach ($this->options['bower_assets']['sass'] as $key => $def) {
$package = $this->getPackage('bower-asset/' . $key);
if (!$package) {
$from = $package ? $this->getInstallationManager()->getInstallPath($package) : NULL;
if (!$package || !$fs->exists($from)) {
unset($this->options['bower_assets']['sass'][$key]);
}
else {
if (!isset($def['version'])) {
$def['version'] = 'latest';
}
$from = $this->getInstallationManager()->getInstallPath($package);
$converter = new Converter($from, $to);
$this->options['bower_assets']['sass'][$key]['src'] = $converter->convert($def['src']);
$dependencies[] = '"' . $key . '": "' . $def['version'] . '"';
......@@ -371,14 +373,12 @@ class Handler
}
}
if ($update) {
// Run Gulp
$args = ['default'];
if (!$event->isDevMode()) {
$args[] = '--env production';
}
$this->gulp(implode(' ', $args));
// Run Gulp
$args = ['default'];
if (!$event->isDevMode()) {
$args[] = '--env production';
}
$this->gulp(implode(' ', $args));
// Restore current directory
chdir($currentDir);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment