Ensure the /src folder has the latest tag of Sizzle
@param {Object} Release
@param {Function} callback
326219
function ensureSizzle( Release, callback ) {
	console.log();
	console.log( "Checking Sizzle version..." );
	getLatestSizzle( function( latest ) {
		var match = rversion.exec( fs.readFileSync( sizzleLoc, "utf8" ) ),
			version = match ? match[ 1 ] : "Not Found";

		if ( version !== latest ) {

			// colors is inherited from jquery-release
			console.log(
				"The Sizzle version in the src folder (" + chalk.red( version ) +
				") is not the latest tag (" + chalk.green( latest ) + ")."
			);
			Release.confirm( callback );
		} else {
			console.log( "Sizzle is latest (" + chalk.green( latest ) + ")" );
			callback();
		}
	} );
}
979896
function(callback) {
    //process first all directories and then all files.
    async.mapSeries(['getDirectories', 'getFiles'], (nodeSource, cbMap) => {
      syncDb[nodeSource]((err, nodes) => {
        async.eachSeries(nodes, (node, cb) => {

          // If a node has to be redownloaded do not delete it remotely
          // See: https://github.com/gyselroth/balloon-node-sync/issues/17
          if(node.downloadOriginal) return cb();

          var nodePath = utility.joinPath(node.parent, node.name);

          process.nextTick(() => {
            var nodePath = utility.joinPath(node.parent, node.name);

            if(fsWrap.existsSync(nodePath) === false) {
              //Node doesn't exist localy -> delete it remotely
              deleteNode(node, false, cb);
            } else {
              try {
                var stat = fsWrap.lstatSync(nodePath);
              } catch(e) {
                logger.warning('findDeletedNodes got lstat error on node', {category: 'sync-local-delta', nodePath, code: e.code});
                throw new BlnDeltaError(e.message);
              }

              if(stat.ino === node.ino) {
                //node still exists at given path
                return cb();
              } else {
                deleteNode(node, true, cb);
              }
            }
          });
        }, cbMap);
      });
    }, callback);
  }
1196005
function processRelease (argv, gyp, defaultVersion, defaultRelease) {
  var version = (semver.valid(argv[0]) && argv[0]) || gyp.opts.target || defaultVersion
    , versionSemver = semver.parse(version)
    , overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl
    , isDefaultVersion
    , name
    , distBaseUrl
    , baseUrl
    , libUrl32
    , libUrl64
    , tarballUrl
    , canGetHeaders

  if (!versionSemver) {
    // not a valid semver string, nothing we can do
    return { version: version }
  }
  // flatten version into String
  version = versionSemver.version

  // defaultVersion should come from process.version so ought to be valid semver
  isDefaultVersion = version === semver.parse(defaultVersion).version

  // can't use process.release if we're using --target=x.y.z
  if (!isDefaultVersion)
    defaultRelease = null

  if (defaultRelease) {
    // v3 onward, has process.release
    name = defaultRelease.name
  } else {
    // old node or alternative --target=
    // semver.satisfies() doesn't like prerelease tags so test major directly
    name = 'node'
  }

  // check for the nvm.sh standard mirror env variables
  if (!overrideDistUrl && process.env.NODEJS_ORG_MIRROR)
    overrideDistUrl = process.env.NODEJS_ORG_MIRROR

  if (overrideDistUrl)
    log.verbose('download', 'using dist-url', overrideDistUrl)

  if (overrideDistUrl)
    distBaseUrl = overrideDistUrl.replace(/\/+$/, '')
  else
    distBaseUrl = 'https://nodejs.org/dist'
  distBaseUrl += '/v' + version + '/'

  // new style, based on process.release so we have a lot of the data we need
  if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) {
    baseUrl = url.resolve(defaultRelease.headersUrl, './')
    libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major)
    libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major)
    tarballUrl = defaultRelease.headersUrl
  } else {
    // older versions without process.release are captured here and we have to make
    // a lot of assumptions, additionally if you --target=x.y.z then we can't use the
    // current process.release
    baseUrl = distBaseUrl
    libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major)
    libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major)

    // making the bold assumption that anything with a version number >3.0.0 will
    // have a *-headers.tar.gz file in its dist location, even some frankenstein
    // custom version
    canGetHeaders = semver.satisfies(versionSemver, headersTarballRange)
    tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz')
  }

  return {
    version: version,
    semver: versionSemver,
    name: name,
    baseUrl: baseUrl,
    tarballUrl: tarballUrl,
    shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'),
    versionDir: (name !== 'node' ? name + '-' : '') + version,
    libUrl32: libUrl32,
    libUrl64: libUrl64,
    libPath32: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)),
    libPath64: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path))
  }
}
1267678
function releaseSnapshot(app, uid, cb) {
  logger.debug('releaseSnapshot entry');

  app.models.snapshot.release(uid,
    function(err) {
      if (err) {
        logger.error(err);
      }
      logger.debug('releaseSnapshot exit');
      if (cb) {
        cb(err);
      }
    });
}
770871
function gitHubRelease() {
			rbot.log.info('Releasing ' + commit.versionTag + ' via ' + options.gitHostname);
			// GitHub Release API will not remove the tag when removing a
			// release
			github.releaseAndUploadAsset(distAssets, coopt.regexLines, commit, tmpltData.name, chgLogRtn
					|| commit.message, options, rollCall, rollbackTag, function() {
				rollCall.then(publish);
			});
		}
1090864
function(parent, fileName, callback) {
			fs.stat(parent, function(err, stat) {
				if (err) {
					return callback(err);
				}

				if (stat.isFile()) {
					parent = path.dirname(parent);
				}

				var filepath = path.resolve(parent, fileName);
				callback(null, filepath);
			});
		}
174268
function tagRelease(done) {
  fs.readFile(config.pkg, 'utf-8', (err, content) => {
    if (err) {
      done(err);
      return;
    }

    const pkg = JSON.parse(content);
    const version = pkg.version;
    git.tag(`v${version}`, `release: tag version ${version}`, done);
  });
}
273287
function(checks, callback) {
      fs.lstat(options.source, function(err, stats) {
        /* istanbul ignore else  */
        if (stats.isFile()) {
          copyFile(options, callback);
        } else if (stats.isDirectory()) {
          copyDir(options, callback);
        } else if (stats.isSymbolicLink()) {
          copySymlink(options, callback);
        } else {
          callback(new Error('Unsupported file type !'));
        }
      });
    }
39256
function performRelease() {
  return gulp.src([config.pkg, config.dist])
      .pipe(git.add({args: '-f'}))
      .pipe(git.commit('release: release version'));
}
562753
function (files, callback) {
		//loop on all files and write them
		async.each(files, function (fileObj, mCb) {
			var data = swagger.cloneObj(fileObj.data);
			
			//if tokens, replace all occurences with corresponding values
			if (fileObj.tokens) {
				for (var i in fileObj.tokens) {
					var regexp = new RegExp("%" + i + "%", "g");
					data = data.replace(regexp, fileObj.tokens[i]);
				}
			}
			if (fileObj.purify) {
				data = data.replace(/\\"/g, '"').replace(/["]+/g, '"').replace(/"__dirname/g, '__dirname');
				data = data.replace(/("group": "__empty__")/g, '"group": ""');
				data = data.replace(/("prefix": "(\s?|\s+),)/g, '"prefix": "",');
				data = data.replace(/("l": "__empty__")/g, '"l": ""');
				//"__dirname + \"/lib/mw/_get.js\""
				//"__dirname + "/lib/mw/_get.js""
				//"__dirname + "/lib/mw/_get.js"
				//__dirname + "/lib/mw/_get.js"
			}
			console.log("creating file:", fileObj.file);
			fs.writeFile(fileObj.file, data, "utf8", mCb);
		}, function (error) {
			if (error) {
				return callback({"code": 854, "msg": error.message});
			}
			return callback(null, true);
		});
	}
794938
function(source, destination, i, callback, excluded) {
        var isExcluded = false;
        if ( typeof(excluded) != 'undefined' && excluded != undefined) {
            var f, p = source.split('/');
            f = p[p.length-1];
            for (var r= 0; r<excluded.length; ++r) {
                if ( typeof(excluded[r]) == 'object' ) {
                    if (excluded[r].test(f)) {
                        isExcluded = true
                    }
                } else if (f === excluded[r]) {
                    isExcluded = true
                }
            }
        }


        if (!isExcluded) {
            fs.lstat(destination, function(err, stats) {

                //Means that nothing exists. Needs create.
                if (err) {
                    startCopy(source, destination, i, function(err, i) {
                        //TODO - log error.
                        callback(err, source, i)
                    })
                } else {

                    if ( stats.isDirectory() ) {
                        var str;
                        var path = '/'+ (str = source.split(/\//g))[str.length-1];
                        destination += path
                    }

                    fs.exists(destination, function(replaceFlag) {
                        if (replaceFlag) {
                            fs.unlink(destination, function(err) {
                                //TODO - log error.
                                startCopy(source, destination, i, function(err, i) {

                                    callback(err, source, i)
                                })
                            })
                        } else {
                            startCopy(source, destination, i, function(err, i) {
                                //TODO - log error.
                                callback(err, source, i)
                            })
                        }
                    })
                }//EO if (err)
            })
        } else {
            callback(false, source, i)
        }

        var startCopy = function(source, destination, i, callback) {

            copyFile(source, destination, i, function(err, i) {
                if (err) {
                    console.error(err.stack)
                }
                callback(err, i)
            })
        }
    }
1232312
function release(type) {
    target.test();
    exec("npm version " + type);
    target.changelog();
    exec("git push origin master --tags");
    exec("npm publish");
}
1240363
function watchColorPaletteFile(filePath, callback) {
  chokidar
    .watch(filePath, {
      ignoreInitial: true,
    })
    .on('all', function(event, path, stats) {
      if (event === 'add' || event === 'change') {
        getFileHash(filePath, function(hash) {
          if (hash !== colorPaletteHash) {
            colorPaletteHash = hash;
            console.log('Color palette changed! Invalidating cache...');
            callback();
          }
        });
      }
    });
}
1175971
function processGithubFile (options, callback) {
  var item = options.item
  var key = options.key
  var json = options.json

  function respond (content) {
    if (isFeatureCollection(content)) {
      content.name = key
      content.updated_at = json.updated_at
      return content
    }
    return false
  }

  if (item.truncated) {
    return request({
      url: item.raw_url
    }, function (err, content) {
      if (err) return callback(err)

      callback(null, respond(content))
    })
  }

  try {
    var content = JSON.parse(item.content)
  } catch (e) {
    var msg = 'could not parse file contents of ' + key + ': ' + e.message
    return callback(new Error(msg))
  }

  callback(null, respond(content))
}
166615
def _has_tag(version, debug=False):
    
    cmd = sh.git.bake('show-ref', '--verify', '--quiet',
                      "refs/tags/{}".format(version))
    try:
        util.run_command(cmd, debug=debug)
        return True
    except sh.ErrorReturnCode:
        return False
66024
function(callback) {
			fs.stat(outputFile,function(err,stat) {
				if (err) { return callback(null) }
				console.log('Found old ' + outputFile + ' so now removing')
				fs.unlinkSync(outputFile)
        return callback(null)
			})
		}
1105419
function inc(importance) {
  console.log(" ----  >>>  Don't forget: $ git push --tag");
  return gulp.src(['./package.json' ])
    .pipe(plugins.bump({type: importance}))
    .pipe(gulp.dest('./'))
    .pipe(plugins.git.commit('bumps package version'))
    .pipe(plugins.filter('package.json'))
    // .pipe(plugins.tagVersion());
    // FIXME
    // See https://github.com/ikari-pl/gulp-tag-version/issues/4
}