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 {
88 static description = 'Create a note from markdown file'
99
1010 static examples = [
11- `$ hackmd-cli import /path/to/markdown/file.md
11+ `$ hackmd-cli import /path/to/markdown/file.md --team=xxx
1212
1313Your note is available at https://hackmd.io/note-url
1414` ,
@@ -20,14 +20,24 @@ Your note is available at https://hackmd.io/note-url
2020
2121 static flags = {
2222 help : flags . help ( { char : 'h' } ) ,
23+ team : flags . string ( {
24+ char : 't' ,
25+ default : '' ,
26+ description : 'team to use' ,
27+ required : false
28+ } )
2329 }
2430
2531 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+ }
2737
2838 const content = fs . readFileSync ( path . resolve ( process . cwd ( ) , args . file ) , 'utf-8' )
2939 try {
30- const url = await APIClient . newNote ( content )
40+ const url = await APIClient . newNote ( content , { team : flags . team } )
3141 this . log ( `Your note is available at ${ url } ` )
3242 } catch ( err ) {
3343 this . error ( err )
You can’t perform that action at this time.
0 commit comments