Skip to content

Commit

Permalink
bugfix: put compiled binary in next to source file
Browse files Browse the repository at this point in the history
  • Loading branch information
enricozb committed Apr 29, 2024
1 parent 7df97d8 commit f2daf07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use hvmc::{

use parking_lot::Mutex;
use std::{
ffi::OsStr,
fmt::Write,
fs::{self, File},
io::{self, BufRead},
Expand All @@ -33,10 +34,11 @@ fn main() {
CliMode::Compile { file, dylib, transform_args, output } => {
let output = if let Some(output) = output {
output
} else if let Some(file_stem) = file.file_stem() {
file_stem.into()
} else if let Some("hvmc") = file.extension().and_then(OsStr::to_str) {
file.with_extension("")
} else {
eprintln!("file missing `.hvmc` extension; explicitly specify an output path with `--output`.");

process::exit(1);
};

Expand Down

0 comments on commit f2daf07

Please sign in to comment.