File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 */
66
77import { execSync } from 'child_process' ;
8- import { existsSync , readFileSync } from 'fs' ;
9- import { join } from 'path' ;
8+ import { existsSync , readFileSync , mkdirSync } from 'fs' ;
9+ import { join , dirname } from 'path' ;
10+ import { fileURLToPath } from 'url' ;
1011
11- const CLI_PATH = join ( process . cwd ( ) , 'bin' , 'cloudsync.js' ) ;
12- const TEST_DIR = join ( process . cwd ( ) , 'test-workspace' ) ;
12+ const __filename = fileURLToPath ( import . meta. url ) ;
13+ const __dirname = dirname ( __filename ) ;
14+
15+ const CLI_PATH = join ( __dirname , 'bin' , 'cloudsync.js' ) ;
16+ const TEST_DIR = join ( __dirname , 'test-workspace' ) ;
17+
18+ // Ensure test-workspace directory exists
19+ if ( ! existsSync ( TEST_DIR ) ) {
20+ mkdirSync ( TEST_DIR , { recursive : true } ) ;
21+ }
1322
1423function run ( cmd , dir = process . cwd ( ) ) {
1524 try {
You can’t perform that action at this time.
0 commit comments