host/ssh: Fix extension matching for .drv

Oopsie
This commit is contained in:
Zhaofeng Li 2022-09-21 00:40:26 -06:00
parent 8b06bb108e
commit a8e6b999cf

View file

@ -1,5 +1,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::convert::TryInto; use std::convert::TryInto;
use std::ffi::OsStr;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::Stdio; use std::process::Stdio;
use std::time::Duration; use std::time::Duration;
@ -275,7 +276,7 @@ impl Ssh {
command.arg("--substitute-on-destination"); command.arg("--substitute-on-destination");
} }
if path.ends_with(".drv") { if let Some("drv") = path.extension().and_then(OsStr::to_str) {
command.arg("--derivation"); command.arg("--derivation");
} }