MCPcopy Create free account
hub / github.com/cocos/cocos-engine / updateExternal

Function updateExternal

native/utils/git.js:122–153  ·  view source on GitHub ↗
( repo, tag, cb )

Source from the content-addressed store, hash-verified

120}
121
122function 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
155function checkout( repo, branch, fetch, cb ) {
156 var Async = require('async');

Callers

nothing calls this directly

Calls 7

requireFunction · 0.85
execFunction · 0.85
cbFunction · 0.85
joinMethod · 0.80
existsSyncMethod · 0.80
errorMethod · 0.80
nextFunction · 0.50

Tested by

no test coverage detected