...
This commit is contained in:
@@ -19,10 +19,13 @@ let file_content = "This is a test file created by Rhai script.";
|
||||
println(`Creating file: ${test_file}`);
|
||||
// First ensure the directory exists
|
||||
run_command(`mkdir -p ${test_dir}`);
|
||||
// Then create the file using a different approach
|
||||
// Use run_command with sh -c to properly handle shell features
|
||||
let write_cmd = `sh -c 'touch ${test_file} && echo "${file_content}" > ${test_file}'`;
|
||||
let write_result = run_command(write_cmd);
|
||||
// Then create the file using a simpler approach
|
||||
// First touch the file
|
||||
let touch_cmd = `touch ${test_file}`;
|
||||
run_command(touch_cmd);
|
||||
// Then write to it with a separate command
|
||||
let echo_cmd = `echo ${file_content} > ${test_file}`;
|
||||
let write_result = run_command(echo_cmd);
|
||||
println(`File creation result: ${write_result.success}`);
|
||||
|
||||
// Wait a moment to ensure the file is created
|
||||
|
||||
Reference in New Issue
Block a user