This repository was archived by the owner on Dec 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ class WebTerm extends LitElement {
145145 } )
146146 userPackages = userPackages . filter ( p => p . stat . isDirectory ( ) )
147147 for ( let pkg of userPackages ) {
148+ pkg . name = pkg . path . split ( '/' ) . pop ( )
148149 try {
149150 pkg . manifest = JSON . parse ( await navigator . filesystem . readFile ( `/${ pkg . path } /index.json` ) )
150151 } catch ( e ) {
@@ -164,7 +165,7 @@ class WebTerm extends LitElement {
164165
165166 try {
166167 // HACK we use importModule() instead of import() because I could NOT get rollup to leave dynamic imports alone -prf
167- this . commandModules [ pkg . url ] = await importModule ( joinPath ( pkg . url , 'index.js' ) )
168+ this . commandModules [ pkg . name ] = await importModule ( joinPath ( pkg . url , 'index.js' ) )
168169 } catch ( err ) {
169170 this . outputError ( `Failed to load ${ pkg . manifest . title } (${ pkg . url } ) index.js` , err )
170171 continue
@@ -173,7 +174,7 @@ class WebTerm extends LitElement {
173174 for ( let command of commands ) {
174175 if ( ! command . name ) continue
175176 let commandData = {
176- package : pkg . url ,
177+ package : pkg . name || pkg . url ,
177178 name : command . name ,
178179 help : command . help ,
179180 usage : command . usage ,
You can’t perform that action at this time.
0 commit comments