Skip to content

Instantly share code, notes, and snippets.

@zenorocha
Created December 28, 2012 00:17
Show Gist options
  • Select an option

  • Save zenorocha/4393426 to your computer and use it in GitHub Desktop.

Select an option

Save zenorocha/4393426 to your computer and use it in GitHub Desktop.
Docpad Tasks on Yogi Alloy
/*
* Copyright (c) 2012, Liferay Inc. All rights reserved.
* Code licensed under the BSD License:
* https://github.com/liferay/alloy-ui/blob/master/LICENSE.txt
*
* @author Zeno Rocha <zeno.rocha@liferay.com>
*/
// -- Yogi Alloy Header --------------------------------------------------------
var YOGI_PATH = process.env.YOGI_PATH,
YOGI_ALLOY_PATH = __dirname + '/../';
var path = require('path');
function requireAlloy(p) {
return require(path.join(YOGI_ALLOY_PATH, p));
}
function requireYogi(p) {
return require(path.join(YOGI_PATH, p));
}
// -- Requires -----------------------------------------------------------------
var log = requireYogi('lib/log'),
exec = require('child_process').exec;
// -- Docpad ------------------------------------------------------------------
exports.run = function() {
var runner = exec('docpad run');
runner.on('stdout', function(data) {
log.info(data);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment