File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11import * as path from 'path' ;
22import { OVERRIDES_DIR } from './interceptors/terminal/terminal-env-overrides' ;
33
4- import { deleteFile , writeFile } from "./util/fs" ;
4+ import { deleteFile , mkDir , writeFile } from "./util/fs" ;
55
66export const WEBEXTENSION_PATH = path . join ( OVERRIDES_DIR , 'webextension' ) ;
7+ const WEBEXTENSION_CONFIG_PATH = path . join ( WEBEXTENSION_PATH , 'config' ) ;
78
89interface WebExtensionConfig { // Should match config in the WebExtension itself
910 mockRtc : {
@@ -16,7 +17,7 @@ const getConfigKey = (proxyPort: number) =>
1617 `127_0_0_1.${ proxyPort } ` ; // Filename-safe proxy address
1718
1819const getConfigPath = ( proxyPort : number ) =>
19- path . join ( WEBEXTENSION_PATH , 'config' , getConfigKey ( proxyPort ) ) ;
20+ path . join ( WEBEXTENSION_CONFIG_PATH , getConfigKey ( proxyPort ) ) ;
2021
2122export function clearWebExtensionConfig ( httpProxyPort : number ) {
2223 return deleteFile ( getConfigPath ( httpProxyPort ) )
@@ -42,5 +43,6 @@ export async function updateWebExtensionConfig(
4243}
4344
4445async function writeConfig ( proxyPort : number , config : WebExtensionConfig ) {
46+ await mkDir ( WEBEXTENSION_CONFIG_PATH ) . catch ( ( ) => { } ) ; // Make sure the config dir exists
4547 return writeFile ( getConfigPath ( proxyPort ) , JSON . stringify ( config ) ) ;
4648}
You can’t perform that action at this time.
0 commit comments