Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Open
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
8 changes: 8 additions & 0 deletions src/classes/Command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected function configure() {
$this->setDescription( 'Create a snapshot locally.' );
$this->addOption( 'exclude', false, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Exclude a file or directory from the snapshot.' );
$this->addOption( 'exclude_uploads', false, InputOption::VALUE_NONE, 'Exclude uploads from pushed snapshot.' );
$this->addOption( 'include_build_files', false, InputOption::VALUE_NONE, 'Include build files in the snapshot (excluded by default).' );
$this->addOption( 'repository', null, InputOption::VALUE_REQUIRED, 'Repository to use. Defaults to first repository saved in config.' );
$this->addOption( 'small', false, InputOption::VALUE_NONE, 'Trim data and files to create a small snapshot. Note that this action will modify your local.' );
$this->addOption( 'include_files', null, InputOption::VALUE_OPTIONAL, 'Include files in snapshot.', false );
Expand Down Expand Up @@ -107,6 +108,13 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
$exclude[] = './uploads';
}

// By default exclude any build folders, as they can be large and unnecessary for snapshots
// Can be overridden by include_build_files option
if ( empty( $input->getOption( 'include_build_files' ) ) ) {
$exclude[] = '/bower_components';
$exclude[] = '/node_modules';
}

$files = $input->getOption( 'include_files' );
if ( false === $files ) {
$files_question = new ConfirmationQuestion( 'Include files in snapshot? (Y/n) ', true );
Expand Down