Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 5d92286

Browse files
committed
Webterm: Use mount/folder name for package name
1 parent 248b930 commit 5d92286

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/userland/webterm/js/main.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)