Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: path of index.js commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 30, 2018
1 parent 6c90f57 commit 15ed4c5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -11,15 +11,15 @@
"@oclif/command": "^1.4.30",
"@oclif/config": "^1.6.21",
"@oclif/errors": "^1.1.2",
"@oclif/plugin-help": "^2.0.0",
"@oclif/plugin-help": "^2.0.1",
"cli-ux": "^4.4.0",
"debug": "^3.1.0",
"fs-extra": "^6.0.1",
"lodash": "^4.17.10",
"normalize-package-data": "^2.4.0",
"qqjs": "^0.3.9",
"require-resolve": "^0.0.2",
"tslib": "^1.9.1"
"tslib": "^1.9.2"
},
"devDependencies": {
"@oclif/plugin-legacy": "^1.0.15",
Expand All @@ -32,16 +32,16 @@
"@types/lodash": "^4.14.109",
"@types/lodash.template": "^4.4.3",
"@types/mocha": "^5.2.0",
"@types/node": "^10.1.3",
"@types/node": "^10.1.4",
"@types/supports-color": "^5.3.0",
"@types/write-json-file": "^2.2.1",
"aws-sdk": "^2.247.1",
"aws-sdk": "^2.248.1",
"chai": "^4.1.2",
"globby": "^8.0.1",
"mocha": "^5.2.0",
"ts-node": "^6.0.5",
"tslint": "^5.10.0",
"typescript": "^2.8.3"
"typescript": "^2.8.4"
},
"engines": {
"node": ">=8.0.0"
Expand Down
6 changes: 6 additions & 0 deletions src/commands/readme.ts
Expand Up @@ -160,6 +160,12 @@ USAGE
let commandsDir = plugin.pjson.oclif.commands
if (!repo || !repo.url || !commandsDir) return
let commandPath = `${commandsDir.replace('./', '')}/${c.id.replace(/:/g, '/')}.js`
if (process.platform !== 'win32') {
// TODO: make this also work on windows
let base = plugin.name === this.config.name ? this.config.root : `${this.config.root}/node_modules/${plugin.name}`
commandPath = require.resolve(base + '/' + commandPath.replace(/\.js$/, ''))
commandPath = commandPath.replace(base + '/', '')
}
if (plugin.pjson.devDependencies.typescript) {
commandPath = commandPath.replace(/^lib\//, 'src/')
commandPath = commandPath.replace(/\.js$/, '.ts')
Expand Down
34 changes: 17 additions & 17 deletions yarn.lock
Expand Up @@ -54,7 +54,7 @@
debug "^3.1.0"
semver "^5.5.0"

"@oclif/command@^1.4.29", "@oclif/command@^1.4.30":
"@oclif/command@^1.4.30":
version "1.4.30"
resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.4.30.tgz#631eb423182517dc38711d6270aecb621bfa24a9"
dependencies:
Expand Down Expand Up @@ -127,11 +127,11 @@
"@oclif/linewrap" "^1.0.0"
chalk "^2.4.1"

"@oclif/plugin-help@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.0.0.tgz#126f00af0b3274a5479ab70cb7619887049473c1"
"@oclif/plugin-help@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.0.1.tgz#53b4ecbecf00b329feb8e57e2d917cdf3e6870a5"
dependencies:
"@oclif/command" "^1.4.29"
"@oclif/command" "^1.4.30"
chalk "^2.4.1"
indent-string "^3.2.0"
lodash.template "^4.4.0"
Expand Down Expand Up @@ -226,9 +226,9 @@
version "8.10.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.11.tgz#971ea8cb91adbe0b74e3fbd867dec192d5893a5f"

"@types/node@^10.1.3":
version "10.1.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.3.tgz#5c16980936c4e3c83ce64e8ed71fb37bd7aea135"
"@types/node@^10.1.4":
version "10.1.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.1.4.tgz#606651d3f8a8bec08b8cb262161aab9209f4a29d"

"@types/supports-color@^5.3.0":
version "5.3.0"
Expand Down Expand Up @@ -316,9 +316,9 @@ atob@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a"

aws-sdk@^2.247.1:
version "2.247.1"
resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.247.1.tgz#be5f220d40665ac91d3a84a51f029fa05560c4ee"
aws-sdk@^2.248.1:
version "2.248.1"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.248.1.tgz#a6b65d3a1ef9cdc774b0cf9c552af997d2342c03"
dependencies:
buffer "4.9.1"
events "1.1.1"
Expand Down Expand Up @@ -1886,9 +1886,9 @@ tslib@1.9.0, tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1:
version "1.9.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"

tslib@^1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.1.tgz#a5d1f0532a49221c87755cfcc89ca37197242ba7"
tslib@^1.9.2:
version "1.9.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.2.tgz#8be0cc9a1f6dc7727c38deb16c2ebd1a2892988e"

tslint-consistent-codestyle@^1.11.0:
version "1.13.0"
Expand Down Expand Up @@ -1959,9 +1959,9 @@ type-detect@^4.0.0:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"

typescript@^2.8.3:
version "2.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170"
typescript@^2.8.4:
version "2.8.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.4.tgz#0b1db68e6bdfb0b767fa2ab642136a35b059b199"

union-value@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit 15ed4c5

Please sign in to comment.