crates-updater
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -19,6 +19,13 @@ #!/usr/bin/env node | ||
var cratesUpdater = new CratesUpdater_1.CratesUpdater(); | ||
if (program.package && !program.packageVersion) { | ||
if (program.package && program.packageVersion) { | ||
cratesUpdater | ||
.getLatestVersion(program.package) | ||
.then(function (version) { return console.log(version.num); }) | ||
.checkForUpdate(program.package, program.packageVersion) | ||
.then(function (version) { | ||
if (version) { | ||
console.log("An update for " + program.package + " is available: " + version + "."); | ||
} | ||
else { | ||
console.log("No update for " + program.package + " available."); | ||
} | ||
}) | ||
.catch(function (error) { | ||
@@ -31,8 +38,4 @@ console.error(error); | ||
cratesUpdater | ||
.checkForUpdate(program.package, program.packageVersion) | ||
.then(function (version) { | ||
if (version) { | ||
console.log(version); | ||
} | ||
}) | ||
.getLatestVersion(program.package) | ||
.then(function (version) { return console.log(version.num); }) | ||
.catch(function (error) { | ||
@@ -39,0 +42,0 @@ console.error(error); |
@@ -46,3 +46,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var result; | ||
var versions; | ||
return __generator(this, function (_a) { | ||
@@ -52,4 +52,4 @@ switch (_a.label) { | ||
case 1: | ||
result = _a.sent(); | ||
return [2 /*return*/, result.versions]; | ||
versions = (_a.sent()).versions; | ||
return [2 /*return*/, versions]; | ||
} | ||
@@ -61,3 +61,3 @@ }); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var versions, sorted; | ||
var versions; | ||
return __generator(this, function (_a) { | ||
@@ -68,4 +68,3 @@ switch (_a.label) { | ||
versions = _a.sent(); | ||
sorted = versions.sort(function (a, b) { return compareVersions(a.num, b.num); }); | ||
return [2 /*return*/, sorted[versions.length - 1]]; | ||
return [2 /*return*/, versions.sort(function (a, b) { return compareVersions(a.num, b.num); }).pop()]; | ||
} | ||
@@ -72,0 +71,0 @@ }); |
@@ -5,21 +5,25 @@ { | ||
"crates-updater": "dist/cli.js", | ||
"update-crate": "dist/cli.js", | ||
"update-crates": "dist/cli.js" | ||
}, | ||
"dependencies": { | ||
"commander": "2.19.0", | ||
"commander": "2.20.0", | ||
"compare-versions": "3.4.0", | ||
"crates.io": "0.1.0" | ||
"crates.io": "0.3.11" | ||
}, | ||
"description": "Check your Rust packages for updates.", | ||
"devDependencies": { | ||
"@types/node": "11.10.5", | ||
"husky": "1.3.1", | ||
"lint-staged": "8.1.5", | ||
"prettier": "1.16.4", | ||
"@ffflorian/prettier-config": "0.0.3", | ||
"@ffflorian/tslint-config": "0.1.0", | ||
"@semantic-release/changelog": "3.0.2", | ||
"@semantic-release/git": "7.0.8", | ||
"@types/node": "12.0.0", | ||
"husky": "2.2.0", | ||
"lint-staged": "8.1.6", | ||
"prettier": "1.17.0", | ||
"rimraf": "2.6.3", | ||
"tslint": "5.13.1", | ||
"semantic-release": "15.13.12", | ||
"tslint": "5.16.0", | ||
"tslint-config-prettier": "1.18.0", | ||
"tslint-plugin-prettier": "2.0.1", | ||
"typescript": "3.3.3333" | ||
"typescript": "3.4.5" | ||
}, | ||
@@ -43,6 +47,6 @@ "files": [ | ||
"*.ts": [ | ||
"tslint --config tslint.json --project tsconfig.json --fix", | ||
"tslint --project tsconfig.json --fix", | ||
"git add" | ||
], | ||
"*.{json,md,css}": [ | ||
"*.{json,md}": [ | ||
"prettier --write", | ||
@@ -54,2 +58,3 @@ "git add" | ||
"name": "crates-updater", | ||
"prettier": "@ffflorian/prettier-config", | ||
"repository": "https://github.com/ffflorian/crates-updater", | ||
@@ -60,9 +65,13 @@ "scripts": { | ||
"dist": "yarn clean && yarn build", | ||
"fix": "yarn fix:other && yarn fix:ts", | ||
"fix:other": "yarn prettier --write", | ||
"fix:ts": "yarn lint:ts --fix", | ||
"lint": "yarn lint:ts && yarn lint:other", | ||
"lint:other": "yarn prettier --list-different", | ||
"lint:ts": "tslint --config tslint.json --project tsconfig.json \"**/*.ts\"", | ||
"prettier": "prettier --ignore-path .gitignore --write \"**/*.ts\"", | ||
"lint:ts": "tslint --project tsconfig.json", | ||
"prettier": "prettier \"*.{json,md}\"", | ||
"release": "semantic-release", | ||
"test": "exit 0" | ||
}, | ||
"version": "0.2.0" | ||
"version": "0.3.0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13359
13
149
14
+ Added@ffflorian/api-client@0.4.2(transitive)
+ Addedcommander@2.20.0(transitive)
+ Addedcrates.io@0.3.11(transitive)
+ Addedhttp-status-codes@1.3.2(transitive)
- Removedcommander@2.19.0(transitive)
- Removedcrates.io@0.1.0(transitive)
Updatedcommander@2.20.0
Updatedcrates.io@0.3.11