-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:heroku/heroku-cli-addons-admin
- Loading branch information
Showing
8 changed files
with
152 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* tslint:disable */ | ||
import {Command, flags} from '@oclif/command' | ||
|
||
export default class AddonsAdmin extends Command { | ||
static description = 'create and manage add-ons' | ||
|
||
static flags = { | ||
help: flags.help({char: 'h'}) | ||
} | ||
|
||
async run() { | ||
this._help(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* tslint:disable */ | ||
import {Command, flags} from '@oclif/command' | ||
|
||
export default class AddonsAdminManifest extends Command { | ||
static description = 'manage add-on manifests' | ||
|
||
static flags = { | ||
help: flags.help({char: 'h'}) | ||
} | ||
|
||
async run() { | ||
this._help(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* tslint:disable */ | ||
// CommandExtension | ||
import CommandExtension from '../../../CommandExtension'; | ||
|
||
// other packages | ||
import cli from 'cli-ux'; | ||
|
||
// utilities | ||
import { readManifest } from '../../../utils/manifest'; | ||
|
||
export default class Open extends CommandExtension { | ||
static description = 'open add-on dashboard' | ||
|
||
static args = [{name: 'slug', description: 'slug name of add-on'}]; | ||
|
||
static examples = [ | ||
`$ heroku addons:admin:open | ||
Checking addon_manifest.json... done | ||
Opening https://addons-next.heroku.com/addons/testing-123... done`, ]; | ||
|
||
|
||
async run() { | ||
const {args} = this.parse(Open); | ||
|
||
let slug: string; | ||
|
||
// check if user gave slug argument | ||
if (args.slug) { | ||
slug = args.slug | ||
} else { | ||
// if not use slug specified in manifest | ||
cli.action.start('Checking addon_manifest.json') | ||
const manifest = await readManifest.apply(this) | ||
cli.action.stop() | ||
|
||
slug = JSON.parse(manifest).id; | ||
} | ||
|
||
const url = `https://addons-next.heroku.com/addons/${slug}` | ||
|
||
cli.action.start(`Opening ${url}`) | ||
cli.open(url) | ||
cli.action.stop() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* tslint:disable */ | ||
// import {expect, test} from '@oclif/test' | ||
// | ||
// describe('addons:admin', () => { | ||
// test | ||
// .stdout() | ||
// .command(['addons:admin']) | ||
// .it('runs hello', ctx => { | ||
// expect(ctx.stdout).to.contain('hello world') | ||
// }) | ||
// | ||
// test | ||
// .stdout() | ||
// .command(['addons:admin', '--name', 'jeff']) | ||
// .it('runs hello --name jeff', ctx => { | ||
// expect(ctx.stdout).to.contain('hello jeff') | ||
// }) | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* tslint:disable */ | ||
// import {expect, test} from '@oclif/test' | ||
// | ||
// describe('addons:admin:manifest', () => { | ||
// test | ||
// .stdout() | ||
// .command(['addons:admin:manifest']) | ||
// .it('runs hello', ctx => { | ||
// expect(ctx.stdout).to.contain('hello world') | ||
// }) | ||
// | ||
// test | ||
// .stdout() | ||
// .command(['addons:admin:manifest', '--name', 'jeff']) | ||
// .it('runs hello --name jeff', ctx => { | ||
// expect(ctx.stdout).to.contain('hello jeff') | ||
// }) | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* tslint:disable */ | ||
// import {expect, test} from '@oclif/test' | ||
// | ||
// describe('addons:admin:open', () => { | ||
// test | ||
// .stdout() | ||
// .command(['addons:admin:open']) | ||
// .it('runs hello', ctx => { | ||
// expect(ctx.stdout).to.contain('hello world') | ||
// }) | ||
// | ||
// test | ||
// .stdout() | ||
// .command(['addons:admin:open', '--name', 'jeff']) | ||
// .it('runs hello --name jeff', ctx => { | ||
// expect(ctx.stdout).to.contain('hello jeff') | ||
// }) | ||
// }) |