Skip to content

Commit c12caa5

Browse files
committed
Fix --temp
The new trigger code expects the working directory to be absolute, which is the case for tempdirs but not necessarily `--temp`. Fix by `.canonicalize()`ing the work dir. Signed-off-by: Lann Martin <[email protected]>
1 parent 4ee7dc7 commit c12caa5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/commands/up.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,18 @@ impl UpCommand {
119119
None => WorkingDirectory::Temporary(tempfile::tempdir()?),
120120
Some(d) => WorkingDirectory::Given(d.to_owned()),
121121
};
122-
let working_dir = working_dir_holder.path();
122+
let working_dir = working_dir_holder.path().canonicalize()?;
123123

124124
let mut app = match (&self.app, &self.bindle) {
125125
(app, None) => {
126126
let manifest_file = app
127127
.as_deref()
128128
.unwrap_or_else(|| DEFAULT_MANIFEST_FILE.as_ref());
129129
let bindle_connection = self.bindle_connection();
130-
spin_loader::from_file(manifest_file, working_dir, &bindle_connection).await?
130+
spin_loader::from_file(manifest_file, &working_dir, &bindle_connection).await?
131131
}
132132
(None, Some(bindle)) => match &self.server {
133-
Some(server) => spin_loader::from_bindle(bindle, server, working_dir).await?,
133+
Some(server) => spin_loader::from_bindle(bindle, server, &working_dir).await?,
134134
_ => bail!("Loading from a bindle requires a Bindle server URL"),
135135
},
136136
(Some(_), Some(_)) => bail!("Specify only one of app file or bindle ID"),
@@ -149,7 +149,7 @@ impl UpCommand {
149149
};
150150

151151
// Build and write app lock file
152-
let locked_app = spin_trigger::locked::build_locked_app(app, working_dir)?;
152+
let locked_app = spin_trigger::locked::build_locked_app(app, &working_dir)?;
153153
let locked_path = working_dir.join("spin.lock");
154154
let locked_app_contents =
155155
serde_json::to_vec_pretty(&locked_app).context("failed to serialize locked app")?;

0 commit comments

Comments
 (0)