|
31 | 31 | const fs = require('fs-extra'); |
32 | 32 | const fg = require('fast-glob'); |
33 | 33 | const path = require('path'); |
34 | | -const Package = require('./package.js'); |
35 | 34 | const consola = require('consola'); |
| 35 | +const Package = require('./package.js'); |
| 36 | +const {getPrefix} = require('./utils/vfs.js'); |
36 | 37 | const logger = consola.withTag('Packages'); |
37 | 38 |
|
38 | 39 | const relative = filename => filename.replace(process.cwd(), ''); |
@@ -155,11 +156,17 @@ class Packages { |
155 | 156 | * @return {Package[]} List of packages |
156 | 157 | */ |
157 | 158 | async readPackageManifests(paths, user) { |
158 | | - const {realpath} = this.core.make('osjs/vfs'); |
| 159 | + const {realpath, mountpoints} = this.core.make('osjs/vfs'); |
159 | 160 | const {manifestFile} = this.options; |
160 | 161 | const systemManifest = await readOrDefault(manifestFile); |
161 | 162 |
|
162 | | - const userManifests = await Promise.all(paths.map(async p => { |
| 163 | + const isValidVfs = p => { |
| 164 | + const prefix = getPrefix(p); |
| 165 | + const mount = mountpoints.find(m => m.name === prefix); |
| 166 | + return mount && mount.attributes.root; |
| 167 | + }; |
| 168 | + |
| 169 | + const userManifests = await Promise.all(paths.filter(isValidVfs).map(async p => { |
163 | 170 | const real = await realpath(`${p}/metadata.json`, user); |
164 | 171 | const list = await readOrDefault(real); |
165 | 172 |
|
|
0 commit comments