@@ -5,7 +5,7 @@ import { join, normalize } from 'node:path';
55import { W3C_ELEMENT_KEY , errors } from '@appium/base-driver' ;
66import { Element , Rect } from '@appium/types' ;
77import { NovaWindowsDriver } from '../driver' ;
8- import { $ , sleep } from '../util' ;
8+ import { $ , getBundledFfmpegPath , sleep } from '../util' ;
99import { POWER_SHELL_FEATURE } from '../constants' ;
1010import { keyDown ,
1111 keyUp ,
@@ -30,7 +30,6 @@ import {
3030 pwsh
3131} from '../powershell' ;
3232import { ClickType , Enum , Key } from '../enums' ;
33- import { getBundledFfmpegPath } from '../util' ;
3433
3534const PLATFORM_COMMAND_PREFIX = 'windows:' ;
3635
@@ -827,7 +826,7 @@ export async function deleteFile(this: NovaWindowsDriver, args: { path: string }
827826 throw new errors . InvalidArgumentError ( "'path' must be provided." ) ;
828827 }
829828 const escapedPath = args . path . replace ( / ' / g, "''" ) ;
830- const useLiteralPath = / [ \[ \ ]? ] / . test ( args . path ) ;
829+ const useLiteralPath = / [ [ \] [ ] ? ] / . test ( args . path ) ;
831830 const pathParam = useLiteralPath ? `-LiteralPath '${ escapedPath } '` : `-Path '${ escapedPath } '` ;
832831 await this . sendPowerShellCommand ( `Remove-Item ${ pathParam } -Force -ErrorAction Stop` ) ;
833832}
@@ -838,7 +837,7 @@ export async function deleteFolder(this: NovaWindowsDriver, args: { path: string
838837 }
839838 const { path : pathArg , recursive = true } = args ;
840839 const escapedPath = pathArg . replace ( / ' / g, "''" ) ;
841- const useLiteralPath = / [ \[ \ ]? ] / . test ( pathArg ) ;
840+ const useLiteralPath = / [ [ \] [ ] ? ] / . test ( pathArg ) ;
842841 const pathParam = useLiteralPath ? `-LiteralPath '${ escapedPath } '` : `-Path '${ escapedPath } '` ;
843842 const recurseFlag = recursive ? ' -Recurse' : '' ;
844843 await this . sendPowerShellCommand ( `Remove-Item ${ pathParam } -Force${ recurseFlag } -ErrorAction Stop` ) ;
0 commit comments