Skip to content

Commit

Permalink
compiler: Add more work for --output-dir handling
Browse files Browse the repository at this point in the history
DCO-1.1-Signed-off-by: Ellie <[email protected]>
  • Loading branch information
ell1e committed Nov 15, 2023
1 parent bbd4276 commit 09c9796
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/compiler/main.h64
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import argparse from core.horse64.org
import io from core.horse64.org
import json from core.horse64.org
import path from core.horse64.org
import system from core.horse64.org
import uri from core.horse64.org

Expand Down Expand Up @@ -525,13 +526,25 @@ func actionparser_compile(args) {
rel_path = pfile.modinfo.rel_path
}
var fname = uri.basename(furi)
var output_furi = uri.add_part(
var write_folder_uri = uri.add_part(
opt_output_dir,
rel_path)
output_furi = uri.add_part(
output_furi, fname)
print("WRITING: " + [
furi, output_furi].as_str())
path.dirname(rel_path))
var write_furi = uri.add_part(
write_folder_uri, fname)
if uri.get_protocol(write_folder_uri).lower() !=
"file" {
throw new NotImplementedError(
"Can't make directory using this "
"remote protocol.")
}
write_folder_path = uri.to_file_or_vfs_path(
write_folder_uri)
io.make_dir(uri.to_file_or_vfs_path(
write_folder_uri), allow_vfs=no,
allow_nested=yes, ignore_exists=yes) later:

print("WRITING: " + [write_folder_path,
furi, write_furi].as_str())
return later yes
}
assert(opt_output_dir != none)
Expand Down

0 comments on commit 09c9796

Please sign in to comment.