@@ -16,10 +16,16 @@ import {
1616export default class Update extends HackMDCommand {
1717 static description = 'Update team folder'
1818 static examples = [
19- `$ hackmd-cli team-folders update --teamPath=CLI-test --folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d --name='team-docs' --parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c --description='Docs' --icon=1F600 --color=blue
20- ID Name Parent Folder ID Color Description Icon
21- ──────────────────────────────────── ───────── ──────────────────────────────────── ───── ─────────── ─────
22- a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c blue Docs 1F600` ,
19+ [
20+ '$ hackmd-cli team-folders update --teamPath=CLI-test ' ,
21+ '--folderId=a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d ' ,
22+ "--name='team-docs' " ,
23+ '--parentFolderId=fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c ' ,
24+ "--description='Docs' --icon=1F600 --color=blue\n" ,
25+ 'ID Name Parent Folder ID Color Description Icon\n' ,
26+ '──────────────────────────────────── ───────── ──────────────────────────────────── ───── ─────────── ─────\n' ,
27+ 'a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e01c blue Docs 1F600' ,
28+ ] . join ( '' ) ,
2329 ]
2430 static flags = {
2531 color : folderColor ,
@@ -57,21 +63,31 @@ a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d team-docs fc7a3d48-4a07-4cbf-bf4f-e65dd896e
5763 const APIClient = await this . getAPIClient ( )
5864 const folder = await APIClient . updateTeamFolder ( teamPath , folderId , payload )
5965
60- ux . table ( [ folder ] , {
61- id : {
62- header : 'ID' ,
66+ ux . table (
67+ [ folder ] ,
68+ Object . fromEntries ( [
69+ [
70+ 'id' ,
71+ {
72+ header : 'ID' ,
73+ } ,
74+ ] ,
75+ [ 'name' , { } ] ,
76+ [
77+ 'parentFolderId' ,
78+ {
79+ header : 'Parent Folder ID' ,
80+ } ,
81+ ] ,
82+ [ 'color' , { } ] ,
83+ [ 'description' , { } ] ,
84+ [ 'icon' , { } ] ,
85+ ] ) ,
86+ {
87+ printLine : this . log . bind ( this ) ,
88+ ...flags ,
6389 } ,
64- name : { } ,
65- parentFolderId : {
66- header : 'Parent Folder ID' ,
67- } ,
68- color : { } ,
69- description : { } ,
70- icon : { } ,
71- } , {
72- printLine : this . log . bind ( this ) ,
73- ...flags ,
74- } )
90+ )
7591 } catch ( error ) {
7692 this . log ( 'Update team folder failed' )
7793 this . error ( error as Error )
0 commit comments