diff --git a/package.json b/package.json index 62e951ac..64f1acc3 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "semver": "^5.5.0" }, "devDependencies": { - "@oclif/dev-cli": "^1.13.6", + "@oclif/dev-cli": "^1.13.7", "@oclif/test": "^1.0.5", "@oclif/tslint": "^1.1.0", "@types/chai": "^4.1.3", diff --git a/src/get_version.ts b/src/get_version.ts index efe08df9..59495f5e 100644 --- a/src/get_version.ts +++ b/src/get_version.ts @@ -1,16 +1,8 @@ import * as fs from 'fs-extra' import HTTP from 'http-call' -async function touch(file: string) { - if (!await fs.pathExists(file)) { - await fs.outputJSON(file, {}) - } else { - await fs.utimes(file, new Date(), new Date()) - } -} - async function run(name: string, file: string, version: string) { - await touch(file) + await fs.outputJSON(file, {current: version}) // touch file with current version to prevent multiple updates const {body} = await HTTP.get(`https://registry.npmjs.org/${name.replace('/', '%2f')}`, {timeout: 5000}) await fs.outputJSON(file, {...body['dist-tags'], current: version}) process.exit(0) diff --git a/yarn.lock b/yarn.lock index ce4aca1e..e2f66be5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25,7 +25,7 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@oclif/command@^1.4.13", "@oclif/command@^1.4.14", "@oclif/command@^1.4.15": +"@oclif/command@^1.4.13", "@oclif/command@^1.4.15": version "1.4.15" resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.4.15.tgz#1886c7dd88a40fbc29427bbca04bdb0e1a538133" dependencies: @@ -40,20 +40,20 @@ dependencies: debug "^3.1.0" -"@oclif/dev-cli@^1.13.6": - version "1.13.6" - resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.13.6.tgz#9ef12d771acee7a231753b7ef4611603710f3fc3" +"@oclif/dev-cli@^1.13.7": + version "1.13.7" + resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.13.7.tgz#de93aa07d960835a3ff1cad1a3e5f273d96ae926" dependencies: - "@oclif/command" "^1.4.14" + "@oclif/command" "^1.4.15" "@oclif/config" "^1.6.13" "@oclif/errors" "^1.0.6" "@oclif/plugin-help" "^1.2.5" - cli-ux "^3.3.31" + cli-ux "^3.4.1" debug "^3.1.0" fs-extra "^5.0.0" lodash "^4.17.5" normalize-package-data "^2.4.0" - qqjs "^0.3.6" + qqjs "^0.3.7" require-resolve "^0.0.2" tslib "^1.9.0" @@ -338,7 +338,7 @@ clean-stack@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" -cli-ux@^3.3.31: +cli-ux@^3.4.1: version "3.4.1" resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-3.4.1.tgz#bfa17e75cd1a60547a11c515166117b05ea89cdd" dependencies: @@ -1252,7 +1252,7 @@ pump@^1.0.0: end-of-stream "^1.1.0" once "^1.3.1" -qqjs@^0.3.6: +qqjs@^0.3.7: version "0.3.7" resolved "https://registry.yarnpkg.com/qqjs/-/qqjs-0.3.7.tgz#eb7d481d3cf3e8c9744da0d21d917d1a4b2080d9" dependencies: