FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
hackmd-cli/src/command.ts at develop · hackmdio/hackmd-cli · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
hackmdio
/
hackmd-cli
Public
Notifications
You must be signed in to change notification settings
Fork
12
Star
166
Code
Issues
19
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
hackmd-cli
/
src
/
command.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (21 loc) · 650 Bytes
Breadcrumbs
hackmd-cli
/
src
/
command.ts
Copy path
File metadata and controls
25 lines (21 loc) · 650 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import
{
API
}
from
'@hackmd/api'
import
{
Command
,
ux
}
from
'@oclif/core'
import
config
from
'./config'
import
{
setAccessTokenConfig
}
from
'./utils'
export
default
abstract
class
HackMDCommand
extends
Command
{
async
getAPIClient
(
)
{
const
token
=
config
.
accessToken
||
await
ux
.
prompt
(
'Enter your access token'
,
{
type
:
'hide'
,
}
)
const
APIClient
=
new
API
(
token
,
config
.
hackmdAPIEndpointURL
)
try
{
await
APIClient
.
getMe
(
)
if
(
!
config
.
accessToken
)
{
setAccessTokenConfig
(
token
)
}
return
APIClient
}
catch
{
throw
new
Error
(
'Please ensure your credentials are correct'
)
}
}
}
Back
|
FazBrowse Home
|
New Git URL