Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
8 changes: 5 additions & 3 deletions jigsaw
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ $app->bootstrapWith([
]);

$application = new Symfony\Component\Console\Application('Jigsaw', '1.8.3');
$application->add($app[TightenCo\Jigsaw\Console\InitCommand::class]);
$application->add(new TightenCo\Jigsaw\Console\BuildCommand($app));
$application->add(new TightenCo\Jigsaw\Console\ServeCommand($app));
$application->addCommands([
$app[TightenCo\Jigsaw\Console\InitCommand::class],
new TightenCo\Jigsaw\Console\BuildCommand($app),
new TightenCo\Jigsaw\Console\ServeCommand($app),
]);
$application->setCatchExceptions(false);

TightenCo\Jigsaw\Jigsaw::addUserCommands($application, $app);
Expand Down
4 changes: 1 addition & 3 deletions src/Jigsaw.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public static function registerCommand($command)

public static function addUserCommands($app, $container)
{
foreach (self::$commands as $command) {
$app->add(new $command($container));
}
$app->addCommands(array_map(fn ($command) => new $command($container), self::$commands));
}

protected function buildCollections()
Expand Down
3 changes: 2 additions & 1 deletion tests/CollectionItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,10 @@ public function collection_item_page_metadata_contains_modified_time()

$this->buildSite($files, $config, $pretty = true);

$this->assertEquals(
$this->assertEqualsWithDelta(
$files->getChild('build/collection/page/index.html')->filemtime(),
$this->clean($files->getChild('build/collection/page/index.html')->getContent()),
1, // allow mtimes to be within 1 second difference
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/SiteBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ public function page_metadata_contains_source_file_modified_time()
$files = $this->setupSource(['page.blade.php' => '{{ $page->getModifiedTime() }}']);
$this->buildSite($files, [], $pretty = true);

$this->assertEquals(
$this->assertEqualsWithDelta(
$files->getChild('build/page/index.html')->filemtime(),
$this->clean($files->getChild('build/page/index.html')->getContent()),
1, // allow mtimes to be within 1 second difference
);
}

Expand Down