Skip to content

Commit 1ceb0d1

Browse files
improvement: just pass the current workdir instead
Signed-off-by: Soc Virnyl Estela <contact@uncomfyhalomacro.pl>
1 parent 1a41a5a commit 1ceb0d1

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

cargo/src/cli.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl Opts {
207207
.prefix(VENDOR_PATH_PREFIX)
208208
.rand_bytes(12)
209209
.tempdir()?;
210-
let mut workdir = tempdir_for_workdir.path().to_path_buf();
210+
let workdir = tempdir_for_workdir.path().to_path_buf();
211211
debug!(?workdir);
212212
let target = if let Ok(result) = utils::process_globs(std::path::Path::new(&self.src)) {
213213
result
@@ -249,28 +249,20 @@ impl Opts {
249249
versionrewriteregex: self.versionrewriteregex.clone(),
250250
versionrewritepattern: self.versionrewritepattern.clone(),
251251
depth: 0,
252-
is_temporary: false,
252+
is_temporary: true,
253253
outfile: None,
254254
outdir: Some(self.outdir.to_path_buf()),
255255
reproducible: true,
256256
ignore_git: true,
257257
ignore_hidden: false,
258258
compression: self.compression,
259259
};
260-
let roast_scm_result =
261-
libroast::operations::roast_scm::roast_scm_opts(&roast_scm_args, false);
262-
match roast_scm_result {
263-
Ok(some_path) => match some_path {
264-
Some(local_clone_dir) => workdir = local_clone_dir,
265-
None => {
266-
return Err(io::Error::new(
267-
io::ErrorKind::NotFound,
268-
"Target path does not exist!",
269-
));
270-
}
271-
},
272-
Err(err) => return Err(err),
273-
};
260+
261+
libroast::operations::roast_scm::roast_scm_opts(
262+
Some(workdir.clone()),
263+
&roast_scm_args,
264+
false,
265+
)?;
274266
} else {
275267
return Err(io::Error::new(
276268
io::ErrorKind::InvalidInput,

0 commit comments

Comments
 (0)