From 2a318b24e6124e3fc15267e3663cf28625a38aa8 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Wed, 19 Sep 2018 14:11:05 -0700 Subject: [PATCH] fix: warn if not updatable --- package.json | 22 +++---- src/commands/update.ts | 6 +- yarn.lock | 139 ++++++++++++++++++++++++++++++----------- 3 files changed, 118 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index ab7be0ef..df7b3853 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,14 @@ "dependencies": { "@oclif/color": "^0.0.0", "@oclif/command": "^1.5.4", - "@oclif/config": "^1.8.7", + "@oclif/config": "^1.9.0", "@oclif/errors": "^1.2.2", "@types/semver": "^5.5.0", - "cli-ux": "^4.9.0", + "cli-ux": "^4.9.3", "cross-spawn": "^6.0.5", "debug": "^4.1.0", "filesize": "^3.6.1", - "fs-extra": "^7.0.0", + "fs-extra": "^7.0.1", "http-call": "^5.2.2", "lodash": "^4.17.11", "log-chopper": "^1.0.2", @@ -21,18 +21,18 @@ "tar-fs": "^1.16.3" }, "devDependencies": { - "@oclif/dev-cli": "^1.19.1", - "@oclif/plugin-help": "^2.1.2", - "@oclif/test": "^1.2.1", - "@oclif/tslint": "^3.1.0", - "@types/chai": "^4.1.6", + "@oclif/dev-cli": "^1.19.4", + "@oclif/plugin-help": "^2.1.3", + "@oclif/test": "^1.2.2", + "@oclif/tslint": "^3.1.1", + "@types/chai": "^4.1.7", "@types/cross-spawn": "^6.0.0", "@types/execa": "^0.9.0", "@types/fs-extra": "^5.0.4", "@types/glob": "^7.1.1", - "@types/lodash": "^4.14.117", + "@types/lodash": "^4.14.118", "@types/mocha": "^5.2.5", - "@types/node": "^10.11.7", + "@types/node": "^10.12.5", "@types/supports-color": "^5.3.0", "@types/write-json-file": "^2.2.1", "chai": "^4.2.0", @@ -42,7 +42,7 @@ "ts-node": "^7.0.1", "tslib": "^1.9.3", "tslint": "^5.11.0", - "typescript": "^3.1.3" + "typescript": "^3.1.6" }, "engines": { "node": ">=8.0.0" diff --git a/src/commands/update.ts b/src/commands/update.ts index 74d981e4..bb9137ac 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -115,7 +115,11 @@ export default class UpdateCommand extends Command { } private async skipUpdate(): Promise { - if (!this.config.binPath) return this.config.scopedEnvVar('UPDATE_INSTRUCTIONS') || 'not updatable' + if (!this.config.binPath) { + const instructions = this.config.scopedEnvVar('UPDATE_INSTRUCTIONS') + if (instructions) this.warn(instructions) + return 'not updatable' + } const manifest = await this.fetchManifest() if (this.config.version === manifest.version) { if (this.config.scopedEnvVar('HIDE_UPDATED_MESSAGE')) return 'done' diff --git a/yarn.lock b/yarn.lock index aca9d884..6c11fd02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -43,7 +43,7 @@ supports-color "^5.4.0" tslib "^1" -"@oclif/command@^1.5.0", "@oclif/command@^1.5.2": +"@oclif/command@^1.5.0": version "1.5.2" resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.5.2.tgz#9c3fc042be785f8cec3f8f9c5d7768ebe80bb625" integrity sha512-xNGfzij9l56nkh5fxoHyzI9MpwISp6ZBP3OAZ/SEQyHgPRe4ZrhNHtmoky4X4oZmxzgf317W4c1rUDUCNWWBjQ== @@ -63,14 +63,6 @@ debug "^4.1.0" semver "^5.6.0" -"@oclif/config@^1.8.6": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.8.6.tgz#97c6526e82cf0aa362aeb8201bb0d53423ecca3b" - integrity sha512-ucSR89AZJ0v48d0ZWBXAWJAGe2uiGBNMnnqzE0fbc3/tDiUokgGleL990JFO3KEWrGYF1e+Sb+YMVIcPxaBKiw== - dependencies: - debug "^4.0.1" - tslib "^1.9.3" - "@oclif/config@^1.8.7": version "1.8.7" resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.8.7.tgz#b42cf0a2b5eaee14fb2eb80a26a903c747f5421f" @@ -79,14 +71,22 @@ debug "^4.1.0" tslib "^1.9.3" -"@oclif/dev-cli@^1.19.1": - version "1.19.1" - resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.19.1.tgz#085dd28971d07b66623490f4b026c01c3d902079" - integrity sha512-KmAYCPEUjBnIv+oDCrCYsJQnBZOTxQ7eFDeLWdT6MarrNzDHgUGK8SojSTKO3CjFOT05Sq+ShqdH4NW4ovu+oQ== +"@oclif/config@^1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.9.0.tgz#f0df483bad3988f24cddd4d85fdc8eafa9eb7ff2" + integrity sha512-R9HJvS7x4Ff/VFGlg8b7hxFnuC77y7znr1iXwRay4Jhd/EFJyZRT9d9SHzA6TS8lz9vDTW93xOFakT9AXld4Kg== dependencies: - "@oclif/command" "^1.5.2" - "@oclif/config" "^1.8.6" - "@oclif/errors" "^1.2.1" + debug "^4.1.0" + tslib "^1.9.3" + +"@oclif/dev-cli@^1.19.4": + version "1.19.4" + resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.19.4.tgz#df63be2c7020413f17aa19d05c08d426c7e3bfc0" + integrity sha512-GI3i5lTrTyNaxQWX19Wj3LT9B2GQv52A/adkyFzKFbBqWH/9oYsz+gUbrN+FjvcQQujNmDt4GqM+F+N6V3fzpg== + dependencies: + "@oclif/command" "^1.5.4" + "@oclif/config" "^1.8.7" + "@oclif/errors" "^1.2.2" "@oclif/plugin-help" "^2.1.2" cli-ux "^4.9.0" debug "^4.1.0" @@ -146,31 +146,55 @@ widest-line "^2.0.0" wrap-ansi "^4.0.0" +"@oclif/plugin-help@^2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.1.3.tgz#7ef67a0b520f63c1b4ca54f3a2c117a9852a8699" + integrity sha512-PLowyoPv/piB9jb2CF7UExL/uRq+mOKtNqVfJel3uD3NX2n9bKFYzo5Wxqcf9trQx/S/dI883CPRtwv5dLKP0g== + dependencies: + "@oclif/command" "^1.5.4" + chalk "^2.4.1" + indent-string "^3.2.0" + lodash.template "^4.4.0" + string-width "^2.1.1" + strip-ansi "^5.0.0" + widest-line "^2.0.0" + wrap-ansi "^4.0.0" + "@oclif/screen@^1.0.2": version "1.0.3" resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.3.tgz#da9f3481a0e386abd36ac7c0d2fe6e1d8c1058f7" integrity sha512-0C/7oioV6hvJdojNPpwgV5bAKajtmaY4kP5r+robCvKHyoOdkH15zCwWXX6u9cqM9ukjzDdU1SQrJuMEh8GdGQ== -"@oclif/test@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@oclif/test/-/test-1.2.1.tgz#68f4e9a3849a8717d9c13f94b62b655d099a02d9" - integrity sha512-GOD8CyE+rhCpf68ox3qw40ccR3pMNjtWWEgUpKND8YKCARbVQTOAglAt4lDpOcbGGy/AYl1TfUc4gh91MJeV1A== +"@oclif/screen@^1.0.3": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493" + integrity sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw== + +"@oclif/test@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@oclif/test/-/test-1.2.2.tgz#41f531145bf784b28f076d5b9ec9ca6c7bda0284" + integrity sha512-ig8bwNRQVOqTJL03iSKzkEG0OHp4ai5uDragU1+8RHh1DDs5unF46lyd/zLkIicDZXrmEhlIuAjkBdK1apH6Bw== dependencies: fancy-test "^1.4.1" -"@oclif/tslint@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@oclif/tslint/-/tslint-3.1.0.tgz#4beea4ddeeb9e8964f4c9d15d25349db799311a6" - integrity sha512-oUaw/yvOXI1kGD9DxBzVwmjlPX+pLBpABOleb/jNIg5rv7JmrZ5qg3d2+KptcwfXmaw8TTpTxRdMag8JgFH96A== +"@oclif/tslint@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@oclif/tslint/-/tslint-3.1.1.tgz#e055cdf158630862fd44546f6b8fb1266c9778e7" + integrity sha512-B1ZWbgzwxDhNZLzVnn+JjyFf9u+J9wNwsz/ZX9YvA9edRYcdiJz9JikCttGPi35V0NU0TUV4UqTqo/q/wQ06jQ== dependencies: tslint-eslint-rules "^5.4.0" tslint-xo "^0.9.0" -"@types/chai@^4.1.4", "@types/chai@^4.1.6": +"@types/chai@^4.1.4": version "4.1.6" resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.6.tgz#1eb26c040e3a84205b1008ad55c800e5e8a94e34" integrity sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw== +"@types/chai@^4.1.7": + version "4.1.7" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.7.tgz#1b8e33b61a8c09cbe1f85133071baa0dbf9fa71a" + integrity sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA== + "@types/cross-spawn@^6.0.0": version "6.0.0" resolved "https://registry.yarnpkg.com/@types/cross-spawn/-/cross-spawn-6.0.0.tgz#320aaf1d1a12979f1b84fe7a5590a7e860bf3a80" @@ -211,10 +235,10 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.116.tgz#5ccf215653e3e8c786a58390751033a9adca0eb9" integrity sha512-lRnAtKnxMXcYYXqOiotTmJd74uawNWuPnsnPrrO7HiFuE3npE2iQhfABatbYDyxTNqZNuXzcKGhw37R7RjBFLg== -"@types/lodash@^4.14.117": - version "4.14.117" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.117.tgz#695a7f514182771a1e0f4345d189052ee33c8778" - integrity sha512-xyf2m6tRbz8qQKcxYZa7PA4SllYcay+eh25DN3jmNYY6gSTL7Htc/bttVdkqj2wfJGbeWlQiX8pIyJpKU+tubw== +"@types/lodash@^4.14.118": + version "4.14.118" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.118.tgz#247bab39bfcc6d910d4927c6e06cbc70ec376f27" + integrity sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw== "@types/minimatch@*": version "3.0.3" @@ -238,10 +262,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.4.tgz#e8bd933c3f78795d580ae41d86590bfc1f4f389d" integrity sha512-ojnbBiKkZFYRfQpmtnnWTMw+rzGp/JiystjluW9jgN3VzRwilXddJ6aGQ9V/7iuDG06SBgn7ozW9k3zcAnYjYQ== -"@types/node@^10.11.7": - version "10.11.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.7.tgz#0e75ca9357d646ca754016ca1d68a127ad7e7300" - integrity sha512-yOxFfkN9xUFLyvWaeYj90mlqTJ41CsQzWKS3gXdOMOyPVacUsymejKxJ4/pMW7exouubuEeZLJawGgcNGYlTeg== +"@types/node@^10.12.5": + version "10.12.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.5.tgz#7e7ea1a9b34d2c8d704cb0b755dffbcda34741ad" + integrity sha512-GzdHjq3t3eGLMv92Al90Iq+EoLL+86mPfQhuglbBFO7HiLdC/rkt+zrzJJumAiBF6nsrBWhou22rPW663AAyFw== "@types/semver@^5.5.0": version "5.5.0" @@ -541,6 +565,11 @@ clean-stack@^1.3.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31" integrity sha1-noIVAa6XmYbEax1m0tQy2y/UrjE= +clean-stack@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.0.0.tgz#301bfa9e8dd2d3d984c0e542f7aa67b996f63e0a" + integrity sha512-VEoL9Qh7I8s8iHnV53DaeWSt8NJ0g3khMfK6NiCPB7H657juhro+cSw2O88uo3bo0c0X5usamtXk0/Of0wXa5A== + cli-ux@^4.9.0: version "4.9.0" resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.9.0.tgz#03e235c63c81614811f2400bb46ba140575b27c2" @@ -567,6 +596,33 @@ cli-ux@^4.9.0: supports-hyperlinks "^1.0.1" treeify "^1.1.0" +cli-ux@^4.9.3: + version "4.9.3" + resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.9.3.tgz#4c3e070c1ea23eef010bbdb041192e0661be84ce" + integrity sha512-/1owvF0SZ5Gn54cgrikJ0QskgTzeg30HGjkmjFoaHDJzAqFpuX1DBpFR8aLvsE1J5s9MgeYRENQK4BFwOag5VA== + dependencies: + "@oclif/errors" "^1.2.2" + "@oclif/linewrap" "^1.0.0" + "@oclif/screen" "^1.0.3" + ansi-escapes "^3.1.0" + ansi-styles "^3.2.1" + cardinal "^2.1.1" + chalk "^2.4.1" + clean-stack "^2.0.0" + extract-stack "^1.0.0" + fs-extra "^7.0.0" + hyperlinker "^1.0.0" + indent-string "^3.2.0" + is-wsl "^1.1.0" + lodash "^4.17.11" + password-prompt "^1.0.7" + semver "^5.6.0" + strip-ansi "^5.0.0" + supports-color "^5.5.0" + supports-hyperlinks "^1.0.1" + treeify "^1.1.0" + tslib "^1.9.3" + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -906,6 +962,15 @@ fs-extra@^7.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2175,10 +2240,10 @@ type-detect@^4.0.0, type-detect@^4.0.5: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== -typescript@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.3.tgz#01b70247a6d3c2467f70c45795ef5ea18ce191d5" - integrity sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA== +typescript@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" + integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA== union-value@^1.0.0: version "1.0.0"