Refactored code and added update warning

This commit is contained in:
Wade Wegner 2018-08-06 13:45:46 -05:00
Родитель c3c13648a1
Коммит 059f8d2e26
5 изменённых файлов: 23 добавлений и 14 удалений

Просмотреть файл

@ -10,6 +10,7 @@
"@oclif/command": "^1",
"@oclif/config": "^1",
"@oclif/plugin-help": "^2",
"@oclif/plugin-warn-if-update-available": "^1.3.9",
"@types/lodash": "^4.14.116",
"axios": "^0.18.0",
"lodash": "^4.17.10",
@ -49,7 +50,8 @@
"commands": "./lib/commands",
"bin": "thatconf",
"plugins": [
"@oclif/plugin-help"
"@oclif/plugin-help",
"@oclif/plugin-warn-if-update-available"
]
},
"repository": "wadewegner/thatconf",

Просмотреть файл

@ -19,9 +19,7 @@ export default class Sessions extends Command {
async run() {
const {flags} = this.parse(Sessions)
let url = `https://www.thatconference.com/api3/Session/GetAcceptedSessions?year=${flags.year}`
let {data} = await axios.get(url)
if (flags.level) {
@ -69,4 +67,4 @@ export default class Sessions extends Command {
}
}
}
}
}

Просмотреть файл

@ -14,9 +14,7 @@ export default class Speakers extends Command {
async run() {
const { args, flags } = this.parse(Speakers)
let url = `https://www.thatconference.com/api3/speakers/getspeakers?year=${flags.year}`
let { data } = await axios.get(url)
if (flags.title) {
@ -29,8 +27,6 @@ export default class Speakers extends Command {
data = data.filter((speakers: any) => speakers.Company.toLowerCase().indexOf(flags.company!.toLowerCase()) > -1)
}
//str.indexOf(st) > -1
if (flags.json) {
this.log(JSON.stringify(data))
} else {
@ -63,4 +59,4 @@ export default class Speakers extends Command {
}
}
}
}
}

Просмотреть файл

@ -13,7 +13,7 @@ export default class Tags extends Command {
const {args, flags} = this.parse(Tags)
const url = `https://www.thatconference.com/api3/Session/GetAcceptedSessions?year=${flags.year}`
let {data} = await axios.get(url)
let allTags:string[] = new Array()
@ -32,4 +32,4 @@ export default class Tags extends Command {
this.log(tag)
}
}
}
}

Просмотреть файл

@ -110,7 +110,7 @@
version "1.1.0"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.0.tgz#50c1e2260ac0ed9439a181de3725a0168d59c48a"
"@oclif/command@^1", "@oclif/command@^1.4.30", "@oclif/command@^1.4.33":
"@oclif/command@^1", "@oclif/command@^1.4.21", "@oclif/command@^1.4.30", "@oclif/command@^1.4.33":
version "1.4.36"
resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.4.36.tgz#cca1e02d8264f34be9c2d692a3c81efc0de15fdf"
dependencies:
@ -119,7 +119,7 @@
debug "^3.1.0"
semver "^5.5.0"
"@oclif/config@^1", "@oclif/config@^1.6.33":
"@oclif/config@^1", "@oclif/config@^1.6.17", "@oclif/config@^1.6.33":
version "1.6.33"
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.6.33.tgz#61906143b30751d96dd29991c20c214bf4d9e4ff"
dependencies:
@ -142,7 +142,7 @@
qqjs "^0.3.10"
tslib "^1.9.2"
"@oclif/errors@^1.1.2":
"@oclif/errors@^1.0.11", "@oclif/errors@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.1.2.tgz#2a54aae07a7655cc4523cae270d0a50cbc5dbef3"
dependencies:
@ -176,6 +176,19 @@
widest-line "^2.0.0"
wrap-ansi "^3.0.1"
"@oclif/plugin-warn-if-update-available@^1.3.9":
version "1.3.9"
resolved "https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.3.9.tgz#ed1f55eea994b0e2bd918b4353daa0d937e84ad6"
dependencies:
"@oclif/command" "^1.4.21"
"@oclif/config" "^1.6.17"
"@oclif/errors" "^1.0.11"
chalk "^2.4.1"
debug "^3.1.0"
fs-extra "^6.0.1"
http-call "^5.1.2"
semver "^5.5.0"
"@oclif/screen@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.2.tgz#c9d7c84b0ea60ecec8dd7a9b22c012ba9967aed8"