Skip to content

Commit

Permalink
fix: fixed global config defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 31, 2018
1 parent 08a1232 commit b769c55
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 51 deletions.
10 changes: 1 addition & 9 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#!/usr/bin/env node

const undefault = m => m.__esModule === true ? m.default : m

const fs = require('fs')
const path = require('path')
const dev = fs.existsSync(path.join(__dirname, '../tsconfig.json'))

if (dev) require('ts-node/register')

undefault(require('@anycli/engine'))()
require('@anycli/engine').run()
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/jdxcode/plugins/issues",
"dependencies": {
"@anycli/command": "^0.2.6",
"@anycli/config": "^0.2.0",
"@anycli/config": "^0.2.1",
"@anycli/manifest-file": "^0.2.0",
"@heroku-cli/color": "^1.1.1",
"cli-ux": "^3.3.8",
Expand All @@ -18,9 +18,9 @@
"yarn": "^1.3.2"
},
"devDependencies": {
"@anycli/engine": "^0.1.26",
"@anycli/test": "^0.9.19",
"@anycli/tslint": "^0.1.3",
"@anycli/engine": "^0.1.29",
"@anycli/test": "^0.10.0",
"@anycli/tslint": "^0.2.0",
"@commitlint/cli": "^6.0.2",
"@commitlint/config-conventional": "^6.0.2",
"@types/chai": "^4.1.2",
Expand Down
7 changes: 4 additions & 3 deletions src/commands/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ let examplePlugins = {
}
let bin = 'heroku'
const g = global as any
if (g.config) {
bin = g.config.bin
let pjson = g.config.pjson['cli-engine']
if (g.anycli && g.anycli.config) {
const config = g.anycli.config
bin = config
let pjson = config.pjson.anycli || config.pjson['cli-engine']
if (pjson.help && pjson.help.plugins) {
examplePlugins = pjson.help.plugins
}
Expand Down
7 changes: 4 additions & 3 deletions src/commands/plugins/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import Plugins from '../../plugins'
let examplePlugin = 'heroku-production-status'
let bin = 'heroku'
const g = global as any
if (g.config) {
bin = g.config.bin
let pjson = g.config.pjson.anycli
if (g.anycli && g.anycli.config) {
const config = g.anycli.config
bin = config.bin
let pjson = config.pjson.anycli || config.pjson['cli-engine']
if (pjson.help && pjson.help.plugins) {
examplePlugin = Object.keys(pjson.help.plugins)[0]
}
Expand Down
7 changes: 4 additions & 3 deletions src/commands/plugins/uninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import Plugins from '../../plugins'
let examplePlugin = 'heroku-production-status'
let bin = 'heroku'
const g = global as any
if (g.config) {
bin = g.config.bin
let pjson = g.config.pjson.anycli
if (g.anycli && g.anycli.config) {
const config = g.anycli.config
bin = config.bin
let pjson = config.pjson.anycli || config.pjson['cli-engine']
if (pjson.help && pjson.help.plugins) {
examplePlugin = Object.keys(pjson.help.plugins)[0]
}
Expand Down
48 changes: 19 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
lodash "^4.17.4"
tslib "^1.9.0"

"@anycli/config@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@anycli/config/-/config-0.2.0.tgz#103a1d28bd76f6bd15ddad1cd9091fdb33ec958b"
"@anycli/config@^0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@anycli/config/-/config-0.2.1.tgz#d32fe5036cd194c34ca32ee6bc5e1a4b0ca3c86f"
dependencies:
cli-ux "^3.3.8"
debug "^3.1.0"
Expand All @@ -22,27 +22,17 @@
lodash "^4.17.4"
read-pkg "^3.0.0"

"@anycli/engine@^0.1.26":
version "0.1.26"
resolved "https://registry.yarnpkg.com/@anycli/engine/-/engine-0.1.26.tgz#7c7d06a2527f5b3176eda34e9ef0c0d89d347f40"
"@anycli/engine@^0.1.29":
version "0.1.29"
resolved "https://registry.yarnpkg.com/@anycli/engine/-/engine-0.1.29.tgz#fcc83ca4b8ef5c0f0f9f01a16579d3ef24cfdce7"
dependencies:
"@anycli/manifest-file" "^0.1.0"
"@anycli/manifest-file" "^0.2.0"
cli-ux "^3.3.9"
debug "^3.1.0"
fs-extra "^5.0.0"
globby "^7.1.1"
lodash "^4.17.4"

"@anycli/manifest-file@^0.1.0":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@anycli/manifest-file/-/manifest-file-0.1.1.tgz#b05f983c4b90e46d9f30ea3f023a409cfdda1232"
dependencies:
debug "^3.1.0"
fs-extra "^5.0.0"
load-json-file "^4.0.0"
lodash "^4.17.4"
rwlockfile "^2.0.21"

"@anycli/manifest-file@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@anycli/manifest-file/-/manifest-file-0.2.0.tgz#f9f70fd2afb44178fe907f2a35ad8746eeb1ee97"
Expand All @@ -65,19 +55,19 @@
version "0.0.3"
resolved "https://registry.yarnpkg.com/@anycli/screen/-/screen-0.0.3.tgz#f0afd970c3ed725702948a45a874ede1fdd9362e"

"@anycli/test@^0.9.19":
version "0.9.20"
resolved "https://registry.yarnpkg.com/@anycli/test/-/test-0.9.20.tgz#8b9dda015416409d5fb1f6e6e284bf0859e0aba8"
"@anycli/test@^0.10.0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@anycli/test/-/test-0.10.0.tgz#0861a7bf0cb063a42adb0f086cf984c14024ce46"
dependencies:
fancy-test "^0.6.4"
lodash "^4.17.4"

"@anycli/tslint@^0.1.3":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@anycli/tslint/-/tslint-0.1.4.tgz#9c8d73e07198633a1afdca69cda4b5b844ab3a72"
"@anycli/tslint@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@anycli/tslint/-/tslint-0.2.0.tgz#192a612e3664f7a18fe6ed693de94de6d4563882"
dependencies:
tslint "^5.9.1"
tslint-xo "^0.5.0"
tslint-xo "^0.6.0"

"@commitlint/cli@^6.0.2":
version "6.0.2"
Expand Down Expand Up @@ -2419,19 +2409,19 @@ tslint-eslint-rules@^4.1.1:
tslib "^1.0.0"
tsutils "^1.4.0"

tslint-microsoft-contrib@^5.0.1:
tslint-microsoft-contrib@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-5.0.2.tgz#ecc2a797f777a12f0066944cec0c81a9e7c59ee9"
dependencies:
tsutils "^2.12.1"

tslint-xo@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/tslint-xo/-/tslint-xo-0.5.0.tgz#56e591dcd2731de35e7462a0dfa1214731ba9f27"
tslint-xo@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/tslint-xo/-/tslint-xo-0.6.0.tgz#95a05b8dcac7aaa1f4d6ca1397a3c4c45a8b848e"
dependencies:
tslint-consistent-codestyle "^1.11.0"
tslint-eslint-rules "^4.1.1"
tslint-microsoft-contrib "^5.0.1"
tslint-microsoft-contrib "^5.0.2"

tslint@^5.9.1:
version "5.9.1"
Expand Down

0 comments on commit b769c55

Please sign in to comment.