Skip to content

Commit

Permalink
Fixed the case where a service has no external file to import (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat authored Jul 23, 2020
1 parent bf8d4b2 commit ead07e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,17 @@ function makeVerticesAndEdges(Graph $graph, array $services, array $volumes, arr
addService($graph, $service);

if (isset($definition['extends'])) {
$configuration = readConfiguration(dirname($path).DIRECTORY_SEPARATOR.$definition['extends']['file']);
$extendedServices = fetchServices($configuration);
$extendedVolumes = fetchVolumes($configuration);
$extendedNetworks = fetchVolumes($configuration);
if (isset($definition['extends']['file'])) {
$configuration = readConfiguration(dirname($path) . DIRECTORY_SEPARATOR . $definition['extends']['file']);
$extendedServices = fetchServices($configuration);
$extendedVolumes = fetchVolumes($configuration);
$extendedNetworks = fetchVolumes($configuration);

$graph = makeVerticesAndEdges($graph, $extendedServices, $extendedVolumes, $extendedNetworks, dirname($path).DIRECTORY_SEPARATOR.$definition['extends']['file'], $flags);
$graph = makeVerticesAndEdges($graph, $extendedServices, $extendedVolumes, $extendedNetworks, dirname($path).DIRECTORY_SEPARATOR.$definition['extends']['file'], $flags);
}

addRelation(
addService($graph, $definition['extends']['service']),
addService($graph, $definition['extends']['service']),
$graph->getVertex($service),
'extends'
);
Expand Down

0 comments on commit ead07e8

Please sign in to comment.