function getSource (callback) { // Loads all node/io.js versions. loadVersions((err, versions) => { const source = { project: { versions, latestVersions: { current: latestVersion.current(versions), lts: latestVersion.lts(versions) }, blacklivesmatter: { visible: true, text: '#BlackLivesMatter', link: '/en/black-lives-matter/' }, banner: { visible: true, text: 'New security releases to be made available Sep 15, 2020', link: '/en/blog/vulnerability/september-2020-security-releases/' } } } if (semver.gt(source.project.latestVersions.lts.node, source.project.latestVersions.current.node)) { // If LTS is higher than Current hide it from the main page source.project.latestVersions.hideCurrent = true } callback(err, source) }) }
}; if (this.latestGladysVersion && this.gladysVersion) { infos.new_release_available = semver.gt(this.latestGladysVersion, this.gladysVersion); } else { infos.new_release_available = false;
if (options.version !== 'custom' && semver.gt(`${options.version}.0`, '5.5.0')) { options.command.unshift('docker-php-entrypoint');
console.log(appVersion); let order = semver_sort.asc(Object.keys(migrations)) let migrationStart = order.findIndex((migrationVersion) => { return semver.gt(migrationVersion, appVersion)}) if(migrationStart == -1){ console.log("db current - no migrations needed")
t.ok(parseInt(nodeEnvData['max.old.space.size']) > 0, 'max.old.space.size is positive'); if (semver.gt(process.version, '12.0.0')) { t.skip(); } else if (semver.gt(process.version, '10.0.0')) { t.ok(actualHeapSizeLimit < (maxHeapGuess * 1.05), 'Values for max.old.space.size and max.semi.space.size approximately match heap.size.limit (2)'); } else if (semver.gt(process.version, '6.5.0')) {
it('should display a warning when a component is newer than recommended', function() { for (var key in expectedComponents) { if (expectedComponents[key].recommendedVersion && expectedComponents[key].installedVersion && semver.gt(expectedComponents[key].installedVersion, expectedComponents[key].recommendedVersion)) { expect(reqs[key].newerWarning.isDisplayed()).toBe(true); } } });
async run({v1}) { const semver = require('semver'); const {loadVersions} = require('../utils/version'); const instance = this.system.getInstance(); if (instance.version) { const {latest, latestMajor} = await loadVersions(); const versionToCheck = v1 ? latestMajor.v1 : latest; if (semver.gt(versionToCheck, instance.version)) { const diff = semver.diff(instance.version, versionToCheck); this.ui.log(`New ${diff} version available: ${versionToCheck}`); } } }
function getLatestVersion() { var tags = execSync("git tag"); var latest = _(tags).split("\n") .compact() .sort(semver.gt) .last(); console.log("Latest tag is ", latest); return latest; }
static GE (v1, v2) { return semver.gt(v1, v2) || v1 === v2; }
/** * Normalizes a potential semver range into a semver string * and returns the newest version * @param {String} r1 Semver string (potentially invalid). * @param {String} r2 Semver string (potentially invalid). * @returns {String|undefined} Newest semver version. * * Adapted from @vue/cli under MIT License: * https://github.com/vuejs/vue-cli/blob/f09722c/packages/%40vue/cli/lib/util/mergeDeps.js#L58-L64 */ tryGetNewerRange(r1, r2) { if (r1 === 'latest' || r2 === 'latest') { return r1 === 'latest' ? r1 : r2; } const v1 = this.rangeToVersion(r1); const v2 = this.rangeToVersion(r2); if (semver.valid(v1) && semver.valid(v2)) { return semver.gt(v1, v2) ? r1 : r2; } }
function printArtwork() { let terminal = require('child_process').execSync(`echo $TERM_PROGRAM`); terminal = terminal.toString().trim().replace(/^\n*/, '').replace(/\n*$/, ''); if(terminal === 'iTerm.app') { osascripts.getiTermVersion().then(version => { if (version.indexOf('beta') !== -1) { let split = version.split('beta'); version = split[0]; } if(semver.gt(version, '2.9.0')) { osascripts.getSongArtworkUrl().then((artworkURL) => { console.log(); imgcat(artworkURL, {log: true, height: 8}); }); } }); } }
// Create an index of applications from an array // applications - array of JSTP applications // const createAppsIndex = applications => { const index = new Map(); applications.forEach(application => { let versions = index.get(application.name); if (!versions) { versions = new Map(); index.set(application.name, versions); } if (versions.has(application.version)) { throw new Error( `Multiple instances of application: ${application.name} ` + `with version: ${application.version}` ); } versions.set(application.version, application); const latest = versions.get('latest'); if (!latest || semver.gt(application.version, latest.version)) { versions.set('latest', application); } }); return index; }
function init (data) { if (data && semver.gt(data.version, version)) { console.log(chalk.red(`------ You're running gloria in version ${version}, the latest version is ${data.version}. Run 'npm install -g gloria' to get the latest version ------`)); } // Using yargs to identify commands and arguments // https://www.npmjs.com/package/yargs require(`yargs`) .commandDir(`../commands`) .alias('v', 'version') .version(require(`../version`)) .help() .usage(`Gloria is a static site generator. Use the command init to get started.`) .epilogue(`For more information, check out the documentation in github.com/gloriajs/gloria`) .argv; }
static GT(v1, v2) { return semver.gt(v1, v2); }
/** * Normalizes a potential semver range into a semver string * and returns the newest version * @param {String} r1 Semver string (potentially invalid). * @param {String} r2 Semver string (potentially invalid). * @returns {String|undefined} Newest semver version. * * Adapted from @vue/cli under MIT License: * https://github.com/vuejs/vue-cli/blob/f09722c/packages/%40vue/cli/lib/util/mergeDeps.js#L58-L64 */ tryGetNewerRange(r1, r2) { if (r1 === 'latest' || r2 === 'latest') { return r1 === 'latest' ? r1 : r2; } const v1 = this.rangeToVersion(r1); const v2 = this.rangeToVersion(r2); if (semver.valid(v1) && semver.valid(v2)) { return semver.gt(v1, v2) ? r1 : r2; } }