File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
packages/electron-chrome-web-store/src/browser Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,17 @@ const manifestExists = async (dirPath: string) => {
2323 * Discover list of extensions in the given path.
2424 */
2525async function discoverExtensions ( extensionsPath : string ) : Promise < ExtensionPathInfo [ ] > {
26+ try {
27+ const stat = await fs . promises . stat ( extensionsPath )
28+ if ( ! stat . isDirectory ( ) ) {
29+ d ( '%s is not a directory' , extensionsPath )
30+ return [ ]
31+ }
32+ } catch {
33+ d ( '%s does not exist' , extensionsPath )
34+ return [ ]
35+ }
36+
2637 // Get top level directories
2738 const subDirectories = await fs . promises . readdir ( extensionsPath , {
2839 withFileTypes : true ,
@@ -97,7 +108,7 @@ export async function loadAllExtensions(
97108 allowUnpacked : boolean
98109) {
99110 const extensions = await discoverExtensions ( extensionsPath )
100- d ( 'discovered %d extension(s)' , extensions . length )
111+ d ( 'discovered %d extension(s) in %s ' , extensions . length , extensionsPath )
101112
102113 for ( const ext of extensions ) {
103114 try {
You can’t perform that action at this time.
0 commit comments