Skip to content

Commit

Permalink
Add branch metadata functionality and simple usage
Browse files Browse the repository at this point in the history
  • Loading branch information
leoruhland committed Dec 28, 2015
1 parent 3a7e195 commit 69f9c79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ scripts:
after:
- rm website/couscous.phar

# Set a target branch for deploying your couscous project
branch: gh-pages

# Any variable you put in this file is also available in the Twig layouts:
title: Hello!

Expand Down
7 changes: 6 additions & 1 deletion src/Application/Cli/DeployCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function configure()
null,
InputOption::VALUE_REQUIRED,
'Target branch in which to deploy the website.',
'gh-pages'
false
);
}

Expand All @@ -100,6 +100,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
// Generate the website
$this->generator->generate($project, $output);

// Change the target branch if is needed
if (!$targetBranch) {
$targetBranch = isset($project->metadata['branch']) ? $project->metadata['branch'] : 'gh-pages';
}

$output->writeln('');

// Deploy it
Expand Down

0 comments on commit 69f9c79

Please sign in to comment.