Skip to content

Instantly share code, notes, and snippets.

@oliger
Last active August 29, 2015 14:19
Show Gist options
  • Save oliger/0857d3f709171fe00e12 to your computer and use it in GitHub Desktop.
Save oliger/0857d3f709171fe00e12 to your computer and use it in GitHub Desktop.
const DEPLOYERS = {
sandbox: SanboxDeployer,
iframe: IframeDeployer,
hardcore: HardcoreDeployer
};
function getDeployer(deployment) {
if (DEPLOYERS[deployment.method] == null) {
throw new Error('Deployment method "' + deployment.method + '" does not exist.');
}
return DEPLOYERS[deployment.method];
}
deployments.forEach(function(d) {
getDeployer(d).deploy(d);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment