Skip to content

Commit ecb2b63

Browse files
committed
build: show command output
1 parent feb44f8 commit ecb2b63

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/push.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: MPL-2.0
44

5-
use log::{debug, info};
5+
use log::{debug, error, info};
66
use std::collections::HashMap;
77
use std::path::Path;
88
use thiserror::Error;
@@ -127,7 +127,7 @@ impl<'a> CopyCommand<'a> {
127127
fn build(self) -> Command {
128128
let mut cmd = Command::new("nix");
129129

130-
cmd.arg("copy");
130+
cmd.arg("-L").arg("copy");
131131

132132
if !self.fast_connection {
133133
cmd.arg("--substitute-on-destination");
@@ -174,7 +174,7 @@ impl<'a> BuildCommand<'a> {
174174
};
175175

176176
if supports_flakes {
177-
cmd.arg("build").arg(derivation_name)
177+
cmd.arg("-L").arg("build").arg(derivation_name)
178178
} else {
179179
cmd.arg(derivation_name)
180180
};
@@ -238,9 +238,13 @@ pub async fn push_profile(
238238

239239
let mut build_cmd = build.build(*derivation_name, supports_flakes);
240240

241-
let build_cmd_handle = build_cmd.output().await.map_err(PushProfileError::Build)?;
241+
let build_cmd_handle = build_cmd
242+
.spawn()
243+
.map_err(PushProfileError::Build)?
244+
.wait()
245+
.await;
242246

243-
match build_cmd_handle.status.code() {
247+
match build_cmd_handle.map_err(PushProfileError::Build)?.code() {
244248
Some(0) => (),
245249
a => return Err(PushProfileError::BuildExit(a)),
246250
};
@@ -272,9 +276,13 @@ pub async fn push_profile(
272276

273277
let mut copy_cmd = copy.build();
274278

275-
let copy_exit_cmd_handle = copy_cmd.status().await.map_err(PushProfileError::Copy)?;
279+
let copy_exit_cmd_handle = copy_cmd
280+
.spawn()
281+
.map_err(PushProfileError::Copy)?
282+
.wait()
283+
.await;
276284

277-
match copy_exit_cmd_handle.code() {
285+
match copy_exit_cmd_handle.map_err(PushProfileError::Copy)?.code() {
278286
Some(0) => (),
279287
a => return Err(PushProfileError::CopyExit(a)),
280288
};

0 commit comments

Comments
 (0)