File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
packages/cli/src/commands Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 77import path from 'path' ;
88import fs from 'fs-extra' ;
99import { bundle } from '../bundle/index.js' ;
10+ import { getTmpPath } from '../../core/index.js' ;
1011
1112/**
1213 * Prepares a JSON config file for execution by bundling it to a temporary location.
@@ -27,11 +28,9 @@ export async function prepareBundleForRun(
2728 silent ?: boolean ;
2829 } ,
2930) : Promise < string > {
30- // Create temp directory relative to config (ensures node_modules is findable)
31- const configDir = path . dirname ( path . resolve ( configPath ) ) ;
32- const tempDir = path . join (
33- configDir ,
34- '.tmp' ,
31+ // Create temp directory relative to cwd (ensures node_modules is findable)
32+ const tempDir = getTmpPath (
33+ undefined ,
3534 `run-${ Date . now ( ) } -${ Math . random ( ) . toString ( 36 ) . slice ( 2 , 9 ) } ` ,
3635 ) ;
3736 await fs . ensureDir ( tempDir ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { simulateCore, formatSimulationResult } from './simulator.js';
22import {
33 createCommandLogger ,
44 getErrorMessage ,
5+ getTmpPath ,
56 isStdinPiped ,
67 readStdin ,
78 writeResult ,
@@ -27,7 +28,7 @@ export async function simulateCommand(
2728 // Write stdin to temp file for simulateCore (expects file path)
2829 const fs = await import ( 'fs-extra' ) ;
2930 const path = await import ( 'path' ) ;
30- const tmpPath = path . default . resolve ( '.tmp' , 'stdin-simulate.json' ) ;
31+ const tmpPath = getTmpPath ( undefined , 'stdin-simulate.json' ) ;
3132 await fs . default . ensureDir ( path . default . dirname ( tmpPath ) ) ;
3233 await fs . default . writeFile ( tmpPath , stdinContent , 'utf-8' ) ;
3334 config = tmpPath ;
You can’t perform that action at this time.
0 commit comments