Fix integration test, add option to run directory with wapm.toml

This commit is contained in:
Felix Schütt
2022-10-19 15:15:34 +02:00
parent 3de62868d7
commit b887a835af
2 changed files with 10 additions and 7 deletions

View File

@@ -248,6 +248,13 @@ fn wasmer_main_inner() -> Result<(), anyhow::Error> {
fn try_run_package_or_file(args: &[String], r: &Run) -> Result<(), anyhow::Error> {
// Check "r.path" is a file or a package / command name
if r.path.exists() {
if r.path.is_dir() && r.path.join("wapm.toml").exists() {
let mut args_without_package = args.to_vec();
let _ = args_without_package.remove(1);
return RunWithoutFile::try_parse_from(args_without_package.iter())?
.into_run_args(r.path.clone(), r.command_name.as_deref())?
.execute();
}
return r.execute();
}