tronbox
Version:
TronBox - Simple development framework for Tron
1 lines • 990 B
JavaScript
;var unbox=require("./unbox");module.exports={downloadBox:function downloadBox(url,destination){var tmpDir;var tmpCleanup;return Promise.resolve().then(function(){return unbox.checkDestination(destination)}).then(function(){return unbox.verifyURL(url)}).then(function(){return unbox.setupTempDirectory()}).then(function(dir,func){tmpDir=dir;tmpCleanup=func}).then(function(){return unbox.fetchRepository(url,tmpDir)}).then(function(){return unbox.copyTempIntoDestination(tmpDir,destination)}).then(tmpCleanup)},unpackBox:function unpackBox(destination){var boxConfig;return Promise.resolve().then(function(){return unbox.readBoxConfig(destination)}).then(function(cfg){boxConfig=cfg}).then(function(){return unbox.cleanupUnpack(boxConfig,destination)}).then(function(){return boxConfig})},setupBox:function setupBox(boxConfig,destination){return Promise.resolve().then(function(){return unbox.installBoxDependencies(boxConfig,destination)}).then(function(){return boxConfig})}};