I was reading the code... I will have to look into why this works ;)


-KP


On Mon, Feb 24, 2014 at 8:08 PM, Justin J. Novack
<notifications@github.com>wrote:

> In plugins/noSandbox/index.js:
>
> > +        kodrCI.eventManager.registerHandler("webhook_push", plugin.cloneRepo);
> > +        kodrCI.eventManager.registerHandler("repo_cloneFinished", plugin.cloneFinished);
> > +        kodrCI.eventManager.registerHandler("sandbox_runCode", plugin.runCode);
> > +    }
> > +
> > +    plugin.cloneRepo = function(commitData){
> > +        // consoleOutput should be changed to handle util.format()
> > +        kodrCI.utils.consoleOutput(require('util').format("noSandbox.cloneRepo() :: %s at %s", commitData.repository.name, commitData.commit.ref.short));
> > +        if(fs.existsSync(plugin.buildDir + commitData.repository.name + "-" + commitData.commit.ref.short)) {
> > +            kodrCI.utils.deleteFolderRecursive(plugin.buildDir + commitData.repository.name + "-" + commitData.commit.ref.short);
> > +        }
> > +        var finishedClone = function(){
> > +            kodrCI.eventManager.triggerEvent("repo_cloneFinished", commitData)
> > +        }
> > +        cloneCommand = clone[commitData.repository.config.scm];
> > +        plugin.runCode(commitData, cloneCommand+" "+commitData.repository.config.clone_url+" .").then(finishedClone);
>
> isn't commitData passed when the finishedClone() function was built? This
> works, what are you complaining about?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/kodr-io/kodrCI/pull/1/files#r10020171>
> .
>