File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/core/src/shared/fs Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
1616 isPermissionsError ,
1717 scrubNames ,
1818} from '../errors'
19- import globals from '../extensionGlobals'
19+ import globals , { isWeb } from '../extensionGlobals'
2020import { isWin } from '../vscode/env'
2121import { resolvePath } from '../utilities/pathUtils'
2222import crypto from 'crypto'
@@ -549,6 +549,15 @@ export class FileSystem {
549549 * Follows the cache_dir convention outlined in https://crates.io/crates/dirs
550550 */
551551 getCacheDir ( ) : string {
552+ if ( isWeb ( ) ) {
553+ const homeDir = this . #homeDir
554+ if ( ! homeDir ) {
555+ throw new ToolkitError ( 'Web home directory not found' , {
556+ code : 'WebHomeDirectoryNotFound' ,
557+ } )
558+ }
559+ return homeDir
560+ }
552561 switch ( process . platform ) {
553562 case 'darwin' : {
554563 return _path . join ( this . getUserHomeDir ( ) , 'Library/Caches' )
@@ -566,7 +575,7 @@ export class FileSystem {
566575 return _path . join ( this . getUserHomeDir ( ) , '.cache' )
567576 }
568577 default : {
569- throw new Error ( `Unsupported platform: ${ process . platform } . Expected 'darwin', 'win32', or 'linux'.` )
578+ throw new Error ( `Unsupported platform: ${ process . platform } . Expected 'darwin', 'win32', 'linux'.` )
570579 }
571580 }
572581 }
You can’t perform that action at this time.
0 commit comments