File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default class Import extends Command {
8
8
static description = 'Create a note from markdown file'
9
9
10
10
static examples = [
11
- `$ hackmd-cli import /path/to/markdown/file.md
11
+ `$ hackmd-cli import /path/to/markdown/file.md --team=xxx
12
12
13
13
Your note is available at https://hackmd.io/note-url
14
14
` ,
@@ -20,14 +20,24 @@ Your note is available at https://hackmd.io/note-url
20
20
21
21
static flags = {
22
22
help : flags . help ( { char : 'h' } ) ,
23
+ team : flags . string ( {
24
+ char : 't' ,
25
+ default : '' ,
26
+ description : 'team to use' ,
27
+ required : false
28
+ } )
23
29
}
24
30
25
31
async run ( ) {
26
- const { args} = this . parse ( Import )
32
+ const { args, flags} = this . parse ( Import )
33
+
34
+ if ( ! args . file ) {
35
+ return this . log ( 'No file path specified.' )
36
+ }
27
37
28
38
const content = fs . readFileSync ( path . resolve ( process . cwd ( ) , args . file ) , 'utf-8' )
29
39
try {
30
- const url = await APIClient . newNote ( content )
40
+ const url = await APIClient . newNote ( content , { team : flags . team } )
31
41
this . log ( `Your note is available at ${ url } ` )
32
42
} catch ( err ) {
33
43
this . error ( err )
You can’t perform that action at this time.
0 commit comments