This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Dickey
committed
Apr 21, 2016
1 parent
828b660
commit 513861b
Showing
32 changed files
with
1,383 additions
and
1,411 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
let cli = require('heroku-cli-util'); | ||
let co = require('co'); | ||
let resolve = require('../../lib/resolve'); | ||
let cli = require('heroku-cli-util') | ||
let co = require('co') | ||
let resolve = require('../../lib/resolve') | ||
|
||
function* run (context, heroku) { | ||
let id = context.args.addon.split(':')[0]; | ||
let addon = yield heroku.get(`/addon-services/${encodeURIComponent(id)}`).catch(() => null); | ||
if (!addon) addon = (yield resolve.addon(heroku, context.app, id)).addon_service; | ||
let url = `https://devcenter.heroku.com/articles/${addon.name}`; | ||
function * run (context, heroku) { | ||
let id = context.args.addon.split(':')[0] | ||
let addon = yield heroku.get(`/addon-services/${encodeURIComponent(id)}`).catch(() => null) | ||
if (!addon) addon = (yield resolve.addon(heroku, context.app, id)).addon_service | ||
let url = `https://devcenter.heroku.com/articles/${addon.name}` | ||
|
||
if (context.flags['show-url']) { | ||
cli.log(url); | ||
cli.log(url) | ||
} else { | ||
cli.log(`Opening ${cli.color.cyan(url)}...`); | ||
yield cli.open(url); | ||
cli.log(`Opening ${cli.color.cyan(url)}...`) | ||
yield cli.open(url) | ||
} | ||
} | ||
|
||
module.exports = { | ||
topic: 'addons', | ||
command: 'docs', | ||
wantsApp: true, | ||
needsAuth: true, | ||
args: [{name: 'addon'}], | ||
flags: [{name: 'show-url', description: 'show URL, do not open browser'}], | ||
run: cli.command({preauth: true}, co.wrap(run)), | ||
description: `open an add-on's Dev Center documentation in your browser` | ||
}; | ||
topic: 'addons', | ||
command: 'docs', | ||
wantsApp: true, | ||
needsAuth: true, | ||
args: [{name: 'addon'}], | ||
flags: [{name: 'show-url', description: 'show URL, do not open browser'}], | ||
run: cli.command({preauth: true}, co.wrap(run)), | ||
description: "open an add-on's Dev Center documentation in your browser" | ||
} |
Oops, something went wrong.