Skip to content

Commit 642e51d

Browse files
repl: mkdir temp folder before chdir to avoid startup failure (#26805)
* repl: mkdir temp folder before chdir to avoid startup failure When the REPL temp directory () does not exist, called before , so the inside was never reached and the REPL exited with: V repl error: Could not change the REPL working folder to ...': No such file or directory Fix by calling before in . Fixes #26804 * repl: error out if mkdir_all fails, per review feedback --------- Co-authored-by: Richard Wheeler <18647491+PythonWillRule@users.noreply.github.com>
1 parent 9ec0373 commit 642e51d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎cmd/tools/vrepl.v‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@ fn remove_comment(oline string) string {
458458
}
459459

460460
fn run_repl(workdir string, vrepl_prefix string) int {
461+
os.mkdir_all(workdir) or {
462+
rerror('Could not create the REPL working folder `${workdir}`: ${err}')
463+
return 1
464+
}
461465
os.chdir(workdir) or {
462466
rerror('Could not change the REPL working folder to `${workdir}`: ${err}')
463467
return 1

0 commit comments

Comments
 (0)