File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,17 @@ open Kicadsch
22module SvgSchPainter = MakeSchPainter (SvgPainter )
33open SvgSchPainter
44
5+ let build_outputfilename outdir sch =
6+ let open Filename in
7+ let basefilename =
8+ if String. equal outdir " " then
9+ sch
10+ else
11+ concat outdir (basename sch) in
12+ (remove_extension basefilename) ^ " .svg"
13+
514let process_file init outdir sch =
6- let slen = String. length sch in
7- let fileout = outdir ^ " /" ^ (String. sub sch 0 (slen - 4 )) ^ " .svg" in
15+ let fileout = build_outputfilename outdir sch in
816 let % lwt o = Lwt_io. open_file ~mode: Lwt_io. Output fileout in
917 let % lwt i = Lwt_io. open_file ~mode: Lwt_io. Input sch in
1018 let % lwt endcontext = Lwt_stream. fold parse_line (Lwt_io. read_lines i) init in
@@ -19,7 +27,7 @@ let process_libs libs =
1927let () =
2028 let files = ref [] in
2129 let libs = ref [] in
22- let outpath = ref " . " in
30+ let outpath = ref " " in
2331 let speclist = [
2432 (" -l" , Arg. String (fun lib -> libs := lib::! libs), " specify component library" );
2533 (" -f" , Arg. String (fun sch -> files := sch::! files), " sch file to process" );
You can’t perform that action at this time.
0 commit comments