Skip to content

Commit 56efab9

Browse files
committed
vendor: fix warning ** not found
1 parent 27941ed commit 56efab9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/cmd/vendor.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub fn init(
320320

321321
// Check if includes exist
322322
for path in vendor_package.include_from_upstream.clone() {
323-
if !PathBuf::from(extend_paths(&[path.clone()], dep_path)?[0].clone()).exists() {
323+
if !PathBuf::from(extend_paths(&[path.clone()], dep_path, true)?[0].clone()).exists() {
324324
warnln!("{} not found in upstream, continuing.", path);
325325
}
326326
}
@@ -330,7 +330,7 @@ pub fn init(
330330
true => copy_recursively(
331331
&link_from,
332332
&link_to,
333-
&extend_paths(&vendor_package.include_from_upstream, dep_path)?,
333+
&extend_paths(&vendor_package.include_from_upstream, dep_path, false)?,
334334
&vendor_package
335335
.exclude_from_upstream
336336
.clone()
@@ -470,6 +470,7 @@ pub fn diff(
470470
&extend_paths(
471471
&vendor_package.include_from_upstream,
472472
&vendor_package.target_dir,
473+
false,
473474
)?,
474475
&vendor_package
475476
.exclude_from_upstream
@@ -788,12 +789,13 @@ pub fn copy_recursively(
788789
pub fn extend_paths(
789790
include_from_upstream: &[String],
790791
prefix: impl AsRef<Path>,
792+
dir_only: bool,
791793
) -> Result<Vec<String>> {
792794
include_from_upstream
793795
.iter()
794796
.map(|pattern| {
795797
let pattern_long = PathBuf::from(pattern).prefix_paths(prefix.as_ref())?;
796-
if pattern_long.is_dir() {
798+
if pattern_long.is_dir() && !dir_only {
797799
Ok(String::from(pattern_long.join("**").to_str().unwrap()))
798800
} else {
799801
Ok(String::from(pattern_long.to_str().unwrap()))

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ impl Validate for PartialVendorPackage {
892892
},
893893
include_from_upstream: match self.include_from_upstream {
894894
Some(include_from_upstream) => include_from_upstream,
895-
None => vec![String::from("**")],
895+
None => vec![String::from("")],
896896
},
897897
exclude_from_upstream: {
898898
let mut excl = match self.exclude_from_upstream {

0 commit comments

Comments
 (0)