Skip to content

Commit 47e9107

Browse files
authored
Merge pull request #209 from fermyon/default-spin-toml
cli: `spin up` default to `-f spin.toml`
2 parents 6ac537a + 2a76399 commit 47e9107

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/commands/up.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use std::path::{Path, PathBuf};
66
use structopt::{clap::AppSettings, StructOpt};
77
use tempfile::TempDir;
88

9+
const DEFAULT_MANIFEST_FILE: &str = "spin.toml";
10+
911
const APP_CONFIG_FILE_OPT: &str = "APP_CONFIG_FILE";
1012
const BINDLE_ID_OPT: &str = "BINDLE_ID";
1113
const BINDLE_SERVER_URL_OPT: &str = "BINDLE_SERVER_URL";
@@ -95,8 +97,12 @@ impl UpCommand {
9597
let working_dir = working_dir_holder.path();
9698

9799
let mut app = match (&self.app, &self.bindle) {
98-
(None, None) => bail!("Must specify app file or bindle id"),
99-
(Some(app), None) => spin_loader::from_file(app, working_dir).await?,
100+
(app, None) => {
101+
let manifest_file = app
102+
.as_deref()
103+
.unwrap_or_else(|| DEFAULT_MANIFEST_FILE.as_ref());
104+
spin_loader::from_file(manifest_file, working_dir).await?
105+
}
100106
(None, Some(bindle)) => match &self.server {
101107
Some(server) => spin_loader::from_bindle(bindle, server, working_dir).await?,
102108
_ => bail!("Loading from a bindle requires a Bindle server URL"),

0 commit comments

Comments
 (0)