We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c6a40a commit 568367dCopy full SHA for 568367d
src/packages.js
@@ -181,7 +181,16 @@ class Packages {
181
await fs.mkdir(target);
182
await extract(stream, target);
183
184
- const filenames = await fg(root + '/*/metadata.json');
+ // FIXME: npm packages have a 'package' subdirectory
185
+ if (!await fs.exists(path.resolve(target, 'metadata.json'))) {
186
+ await fs.unlink(target);
187
+
188
+ throw new Error('Invalid package');
189
+ }
190
191
+ // TODO: Check conflicts ?
192
193
+ const filenames = await fg(root + '/*/metadata.json'); // FIXME: Windows!
194
const metadatas = await Promise.all(filenames.map(f => fs.readJson(f)));
195
196
await fs.writeJson(manifest, metadatas);
0 commit comments