Skip to content

Commit

Permalink
Merge branch 'feature/branch-metadata' of https://github.com/leoruhla…
Browse files Browse the repository at this point in the history
…nd/Couscous into branch-selector
  • Loading branch information
mnapoli committed Dec 30, 2015
2 parents 6240f9a + 69f9c79 commit 1cb515a
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 @@ -37,6 +37,9 @@ scripts:
# The content of this variable will be directly inserted into the CNAME file
cname: docs.yourdomain.com

# 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 1cb515a

Please sign in to comment.