Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let registry: BuildpackRegistry
let herokuAuth = this.heroku.auth || ''
if (herokuAuth === '') {
this.error('You need to be logged in to run this command.')
}
registry = new BuildpackRegistry()
Result.match({
Ok: _ => {},
Err: err => {
this.error(`Could not find the buildpack.\n${err}`)
},
}, BuildpackRegistry.isValidBuildpackSlug(args.buildpack))
let result = await registry.listVersions(args.buildpack)
Result.match({
Ok: versions => {
cli.table(versions.sort((a: RevisionBody, b: RevisionBody) => {
return a.release > b.release ? -1 : 1
}), {
columns: [
{key: 'release', label: 'Version'},
{key: 'created_at', label: 'Released At'},
{key: 'status', label: 'Status'}
]
})
},
Err: err => {
if (err.status === 404) {
this.error(`Could not find '${args.buildpack}'`)
} else {
this.error(`Problem fetching versions, ${err.status}: ${err.description}`)
async run() {
let {args} = this.parse(Versions)
let registry: BuildpackRegistry
let herokuAuth = this.heroku.auth || ''
if (herokuAuth === '') {
this.error('You need to be logged in to run this command.')
}
registry = new BuildpackRegistry()
Result.match({
Ok: _ => {},
Err: err => {
this.error(`Could not find the buildpack.\n${err}`)
},
}, BuildpackRegistry.isValidBuildpackSlug(args.buildpack))
let result = await registry.listVersions(args.buildpack)
Result.match({
Ok: versions => {
cli.table(versions.sort((a: RevisionBody, b: RevisionBody) => {
return a.release > b.release ? -1 : 1
}), {
columns: [
{key: 'release', label: 'Version'},
{key: 'created_at', label: 'Released At'},
{key: 'status', label: 'Status'}
async run() {
let {args} = this.parse(Info)
let registry = new BuildpackRegistry()
Result.match({
Ok: _ => {},
Err: err => {
this.error(`Could not publish the buildpack.\n${err}`)
},
}, BuildpackRegistry.isValidBuildpackSlug(args.buildpack))
let result = await registry.info(args.buildpack)
Result.match({
Ok: buildpack => {
cli.styledHeader(args.buildpack)
cli.styledObject(buildpack, ['description', 'category', 'license', 'support', 'source', 'readme'])
},
Err: err => {
if (err.status === 404) {
cli.error(`Could not find the buildpack '${args.buildpack}'`)
} else {
async registryNameToUrl(buildpack: string): Promise {
if (validUrl.isWebUri(buildpack)) {
return buildpack
}
Result.match({
Ok: _ => {},
Err: err => {
cli.error(`Could not find the buildpack: ${buildpack}. ${err}`, {exit: 1})
},
}, BuildpackRegistry.isValidBuildpackSlug(buildpack))
try {
let response = await this.registry.buildpackExists(buildpack)
let body = await response.json()
return body.blob_url
} catch (err) {
if (err.statusCode === 404) {
cli.error(`${buildpack} is not in the buildpack registry.`, {exit: 1})
} else if (err.statusCode) {
cli.error(`${err.statusCode}: ${err.message}`, {exit: 1})
} else {
async run() {
let {args} = this.parse(Info)
let registry = new BuildpackRegistry()
Result.match({
Ok: _ => {},
Err: err => {
this.error(`Could not publish the buildpack.\n${err}`)
},
}, BuildpackRegistry.isValidBuildpackSlug(args.buildpack))
let result = await registry.info(args.buildpack)
Result.match({
Ok: buildpack => {
cli.styledHeader(args.buildpack)
cli.styledObject(buildpack, ['description', 'category', 'license', 'support', 'source', 'readme'])
},
Err: err => {
if (err.status === 404) {
cli.error(`Could not find the buildpack '${args.buildpack}'`)
} else {
cli.error(`Problems finding buildpack info: ${err.description}`)
}
}
}, result)
}
}