Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

Commit

Permalink
Error condition in default gh-pages behavior
Browse files Browse the repository at this point in the history
This section is for setting a default value, so it
shouldn't be able to fail. It should always leave the
repoUri as null in an error condition.
  • Loading branch information
ajoberstar committed Jun 28, 2016
1 parent 77bd53d commit 56ee905
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ class GithubPagesPluginExtension implements AuthenticationSupported {
*/
Object workingPath = "${project.buildDir}/ghpages"

/**
* Whether to delete existing files in the branch, replacing the
* entire contents. Defaults to {@code true}.
*/
boolean deleteExistingFiles = true
/**
* Whether to delete existing files in the branch, replacing the
* entire contents. Defaults to {@code true}.
*/
boolean deleteExistingFiles = true

/**
* The message used when committing changes to Github pages branch.
Expand All @@ -87,6 +87,9 @@ class GithubPagesPluginExtension implements AuthenticationSupported {
Grgit grgit = Grgit.open(currentDir: project.projectDir)
this.repoUri = grgit.remote.list().find { it.name == 'origin' }?.url
grgit.close()
} catch (IllegalArgumentException e) {
// there isn't a git repo
this.repoUri = null
} catch (GrgitException e) {
// failed to open the repo of the current project
this.repoUri = null
Expand Down

0 comments on commit 56ee905

Please sign in to comment.