File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
packages/ui-mobile-visreg Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 4646 "@percy/cli" : " ^1.31.1" ,
4747 "@percy/client" : " ^1.31.1" ,
4848 "@percy/sdk-utils" : " ^1.31.1" ,
49- "lodash" : " ^4.17.21"
49+ "lodash" : " ^4.17.21" ,
50+ "shell-quote" : " ^1.8.3"
5051 },
5152 "devDependencies" : {
5253 "@babel/core" : " ^7.28.0" ,
Original file line number Diff line number Diff line change 11/// <reference types="detox" />
22
33import { execSync } from 'node:child_process' ;
4+ import shellQuote from 'shell-quote' ;
45
56import type { PercyScreenshotOptions } from './percy/processScreenshots' ;
67import processScreenshots from './percy/processScreenshots' ;
@@ -111,8 +112,9 @@ export function processScreenshotsForVisualDiffs(options: {
111112} ) {
112113 const screenshotsDir = options . screenshotsDir ? `/${ options . screenshotsDir } ` : '' ;
113114 const fullDirPath = `${ baseDir } ${ screenshotsDir } ` ;
115+ const quotedDirPath = shellQuote . quote ( [ fullDirPath ] ) ;
114116
115- processScreenshots ( fullDirPath , options . processingOptions ?? { } ) ;
117+ processScreenshots ( quotedDirPath , options . processingOptions ?? { } ) ;
116118}
117119
118120/**
Original file line number Diff line number Diff line change 1- import { runCmd } from '../utils' ;
1+ import { runCmd } from '../utils' ;
2+ import shellQuote from 'shell-quote' ;
23
34export type PercyScreenshotOptions = {
45 skipPercyUpload ?: boolean ;
56 parallelPercy ?: boolean ;
67} ;
78
89function uploadImages ( dirPath : string , parallelPercy = false ) {
9- const percyUploadCmd = `percy upload -c ./.percy.yml -f "./*.{png,jpg,jpeg}" ${ dirPath } ` ;
10+ const safeDirPath = shellQuote . quote ( [ dirPath ] ) ;
11+ const percyUploadCmd = `percy upload -c ./.percy.yml -f "./*.{png,jpg,jpeg}" ${ safeDirPath } ` ;
1012 const cmd = parallelPercy ? `percy exec --parallel -- ${ percyUploadCmd } ` : percyUploadCmd ;
1113 runCmd ( cmd ) ;
1214}
@@ -19,3 +21,4 @@ export default function processScreenshots(
1921 uploadImages ( dirPath , parallelPercy ) ;
2022 }
2123}
24+
You can’t perform that action at this time.
0 commit comments