fix cmd macro misinterpreting quoted strings
This commit is contained in:
parent
336939581d
commit
433fc1af7d
1 changed files with 3 additions and 3 deletions
|
@ -60,7 +60,7 @@ macro_rules! cmd {
|
|||
($command:tt $($args:expr) +$(, $format:tt)*) => {
|
||||
let args = cmd!{@replace $($args) +; $( $format),*}.replace("- -", "--");
|
||||
let _ = std::process::Command::new(stringify!($command))
|
||||
.args(args.split_whitespace())
|
||||
.args(args.replace("\"", "").split_whitespace())
|
||||
.spawn()
|
||||
.expect("Command failed to spawn")
|
||||
.wait();
|
||||
|
@ -231,7 +231,7 @@ fn main() {
|
|||
mount(&disks[root][0], 1, "/mnt/boot", None);
|
||||
if swap {
|
||||
cmd! {btrfs subvolume create "/mnt/swap"}
|
||||
cmd! {btrfs filesystem mkswapfile --size {} --uuid clear "/mnt/swap/swapfile", swap_size};
|
||||
cmd! {swapon "/mnt/swap/swapfile"}
|
||||
cmd! {btrfs filesystem mkswapfile --size {} --uuid clear "/mnt/swap/file", swap_size};
|
||||
cmd! {swapon "/mnt/swap/file"}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue