From 463198f6ca1d816c9fc71ff8c2c5573958ac6e17 Mon Sep 17 00:00:00 2001 From: David Russell Date: Wed, 15 Nov 2017 10:04:46 +0700 Subject: [PATCH] Support for PITCHME.yaml fallback convention. --- app/com/gitpitch/services/GitService.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/com/gitpitch/services/GitService.java b/app/com/gitpitch/services/GitService.java index 7268708..fd71331 100644 --- a/app/com/gitpitch/services/GitService.java +++ b/app/com/gitpitch/services/GitService.java @@ -249,7 +249,23 @@ public class GitService { int downYAML = grsService.download(pp, PitchParams.PITCHME_YAML, pp.YAML()); boolean downOk = downYAML == STATUS_OK; - log.debug("fetchYAML: pp={}, downloaded YAML={}", pp, downYAML); + log.debug("fetchYAML: pp={}, colocated YAML={}", + pp, downYAML); + + /* + * If PITCHME.yaml not found at pp.pitchme path + * try locate file using GitPitch convention + * default by looking in repo root directory. + */ + if(!downOk && pp.pitchme != null) { + downYAML = + grsService.download(pp, + PitchParams.PITCHME_YAML, + PitchParams.PITCHME_YAML); + downOk = downYAML == STATUS_OK; + log.debug("fetchYAML: pp={}, fallback YAML={}", + pp, downYAML); + } /* * Update pitchCache with new SlideshowModel.