Skip to content

Commit

Permalink
more horrible spaghetti in order to properly support publishing the i…
Browse files Browse the repository at this point in the history
…ndex; refactoring badly needed
  • Loading branch information
darobin committed Mar 9, 2015
1 parent e9633e5 commit 8f33ab0
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,30 @@ exports.processRepository = function (data, cb) {
, branch = data.branch
, regen = wanted[repo].regen
, publishDir = jn(dataDir, "publish", wanted[repo].branches[branch])
, gitDir = jn(dataDir, "gits", repo)
;
log.info("Hook regen mode: " + (regen || "default"));
if (regen === "extracted") currentCommon = exports.commonRepositories();
async.series(
[
function (cb) { git.cloneOrFetch(conf.repoTmpl.replace("{repo}", repo), jn(dataDir, "gits", repo), cb); }
, function (cb) { git.publish(jn(dataDir, "gits", repo), branch, publishDir, cb); }
function (cb) { git.cloneOrFetch(conf.repoTmpl.replace("{repo}", repo), gitDir, cb); }
, function (cb) {
if (repo === "webspecs/the-index") {
log.info("Special processing for the-index");
ie.transform(jn(publishDir, "index.html"));
git.publish(
gitDir
, branch
, function (tmpDir, cb) {
log.info("Transforming the-index");
ie.transform(jn(tmpDir, "index.html"), jn(publishDir, "index.html"));
cb();
}
, cb
);
}
else {
git.publish(gitDir, branch, publishDir, cb);
}
cb();
}
, function (cb) {
if (regen === "all") {
Expand Down

0 comments on commit 8f33ab0

Please sign in to comment.