File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
plugins/plugin-codeflare/src/controller Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17- import { Registrar } from "@kui-shell/core"
17+ import { Arguments , Registrar } from "@kui-shell/core"
18+
19+ async function dirs ( args : Arguments ) {
20+ const { join } = await import ( "path" )
21+ await import ( "@kui-shell/plugin-s3" ) . then ( ( _ ) => _ . enable ( ) )
22+ return args . argvNoOptions . slice ( 3 ) . map ( ( _ ) => join ( "/s3" , _ ) )
23+ }
24+
25+ async function ls ( args : Arguments ) {
26+ return args . REPL . qexec ( "ls " + ( await dirs ( args ) ) . join ( " " ) )
27+ }
28+
29+ async function select ( args : Arguments ) {
30+ return args . REPL . qexec ( "ls " + ( await dirs ( args ) ) . join ( " " ) )
31+ }
1832
1933export default function s3Behaviors ( registrar : Registrar ) {
20- registrar . listen ( "/codeflare/s3/ls" , async ( args ) => {
21- const { join } = await import ( "path" )
22- await import ( "@kui-shell/plugin-s3" ) . then ( ( _ ) => _ . enable ( ) )
23- const rest = args . argvNoOptions . slice ( 3 ) . map ( ( _ ) => join ( "/s3" , _ ) )
24- return args . REPL . qexec ( "ls " + rest . join ( " " ) )
25- } )
34+ registrar . listen ( "/codeflare/s3/ls" , ls )
35+ registrar . listen ( "/codeflare/s3/select" , select , { needsUI : true } )
2636}
You can’t perform that action at this time.
0 commit comments