Skip to content

Commit

Permalink
feat: serve option to "no ignore VCS"
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Feb 1, 2024
1 parent 2ece832 commit 67fb9bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Command/Serve.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected function configure()
new InputOption('port', null, InputOption::VALUE_REQUIRED, 'Server port'),
new InputOption('optimize', null, InputOption::VALUE_OPTIONAL, 'Optimize files (disable with "no")', false),
new InputOption('clear-cache', null, InputOption::VALUE_OPTIONAL, 'Clear cache before build (optional cache key regular expression)', false),
new InputOption('no-ignore-vcs', null, InputOption::VALUE_NONE, 'Changes watcher must not ignore VCS directories'),
])
)
->setHelp('Starts the live-reloading-built-in web server');
Expand All @@ -73,6 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$clearcache = $input->getOption('clear-cache');
$verbose = $input->getOption('verbose');
$page = $input->getOption('page');
$noignorevcs = $input->getOption('no-ignore-vcs');

$this->setUpServer($host, $port);

Expand Down Expand Up @@ -158,7 +160,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$finder->files()
->in($this->getPath())
->exclude((string) $this->getBuilder()->getConfig()->get('output.dir'));
if (file_exists(Util::joinFile($this->getPath(), '.gitignore'))) {
if (file_exists(Util::joinFile($this->getPath(), '.gitignore')) && $noignorevcs === false) {
$finder->ignoreVCSIgnored(true);
}
$hashContent = new Crc32ContentHash();
Expand Down

0 comments on commit 67fb9bd

Please sign in to comment.