| 120 | } |
| 121 | |
| 122 | function updateExternal( repo, tag, cb ) { |
| 123 | var Async = require('async'); |
| 124 | var dir = Path.join(__dirname, '../external'); |
| 125 | Async.series([ |
| 126 | function ( next ) { |
| 127 | if (!Fs.existsSync(dir)) { |
| 128 | exec(['clone', repo, './external'], '..', next); |
| 129 | } else { |
| 130 | next(); |
| 131 | } |
| 132 | }, |
| 133 | |
| 134 | function ( next ) { |
| 135 | exec(['fetch', '--all'], dir, next ); |
| 136 | }, |
| 137 | |
| 138 | function ( next ) { |
| 139 | exec(['stash'], dir, next ); |
| 140 | }, |
| 141 | |
| 142 | function ( next ) { |
| 143 | exec(['rev-parse', `tags/${tag}`], dir, next); |
| 144 | }, |
| 145 | ], function ( err ) { |
| 146 | if ( err ) { |
| 147 | console.error(Chalk.red('Failed to update ' + repo + '. Message: ' + err.message )); |
| 148 | if (cb) cb (err); |
| 149 | return; |
| 150 | } |
| 151 | if (cb) cb(); |
| 152 | }); |
| 153 | } |
| 154 | |
| 155 | function checkout( repo, branch, fetch, cb ) { |
| 156 | var Async = require('async'); |