Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: add a legacy flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 29, 2018
1 parent f1e7894 commit 4281658
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ export interface IConfig {
* npm registry to use for installing plugins
*/
npmRegistry: string

/**
* a Heroku pre-dxcli plugin
*/
legacy: boolean
}

export interface ICLIConfig extends IConfig {
Expand Down Expand Up @@ -197,6 +202,7 @@ export class Config implements IConfig {
hooksTS?: {[k: string]: string[]}
engine?: IEngine
npmRegistry: string
legacy = false

constructor() {
this.arch = (os.arch() === 'ia32' ? 'x86' : os.arch() as any)
Expand All @@ -211,7 +217,10 @@ export class Config implements IConfig {

this.name = this.pjson.name
this.version = this.pjson.version
if (!this.pjson.dxcli) this.pjson.dxcli = this.pjson.dxcli || this.pjson['cli-engine'] || {}
if (!this.pjson.dxcli) {
this.legacy = true
this.pjson.dxcli = this.pjson['cli-engine'] || {}
}
this.bin = this.pjson.dxcli.bin || base.bin || this.name
this.dirname = this.pjson.dxcli.dirname || base.dirname || this.name
this.userAgent = `${this.name}/${this.version} (${this.platform}-${this.arch}) node-${process.version}`
Expand Down

0 comments on commit 4281658

Please sign in to comment.