Skip to content

Commit dabb79d

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

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

src/deploy.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,15 @@ pub async fn deploy_profile(
369369
if *no_magic_rollback || *dry_activate {
370370
let ssh_activate_cmd_handle = ssh_activate_cmd
371371
.arg(activate_cmd)
372-
.output()
373-
.await
374-
.map_err(DeployProfileError::SSHActivate)?;
375-
376-
match ssh_activate_cmd_handle.status.code() {
372+
.spawn()
373+
.map_err(DeployProfileError::SSHActivate)?
374+
.wait()
375+
.await;
376+
377+
match ssh_activate_cmd_handle
378+
.map_err(DeployProfileError::SSHActivate)?
379+
.code()
380+
{
377381
Some(0) => (),
378382
a => return Err(DeployProfileError::SSHActivateExit(a)),
379383
};

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)