This commit is contained in:
2025-04-04 18:38:53 +02:00
parent c9b4010089
commit bf5eb2f6fc
10 changed files with 198 additions and 29 deletions

View File

@@ -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