Skip to content

Commit 80a14e4

Browse files
committed
fix clean error
1 parent 1bf1632 commit 80a14e4

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/build/clean.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ pub fn cleanup_after_build(build_state: &BuildState) {
338338
});
339339
}
340340

341-
pub fn clean(path: &str, show_progress: bool, bsc_path: Option<String>) -> Result<()> {
341+
pub fn clean(path: &str, show_progress: bool, bsc_path: Option<String>, build_dev_deps: bool) -> Result<()> {
342342
let project_root = helpers::get_abs_path(path);
343343
let workspace_root = helpers::get_workspace_root(&project_root);
344344
let packages = packages::make(
@@ -347,7 +347,7 @@ pub fn clean(path: &str, show_progress: bool, bsc_path: Option<String>) -> Resul
347347
&workspace_root,
348348
show_progress,
349349
// Always clean dev dependencies
350-
true,
350+
build_dev_deps,
351351
)?;
352352
let root_config_name = packages::read_package_name(&project_root)?;
353353
let bsc_path = match bsc_path {

src/build/packages.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,17 +510,19 @@ pub fn get_source_files(
510510
};
511511

512512
let path_dir = Path::new(&source.dir);
513-
if (build_dev_deps && type_ == &Some("dev".to_string())) || type_ != &Some("dev".to_string()) {
514-
match read_folders(filter, package_dir, path_dir, recurse) {
513+
match (build_dev_deps, type_) {
514+
(false, Some(type_)) if type_ == "dev" => (),
515+
_ => match read_folders(filter, package_dir, path_dir, recurse) {
515516
Ok(files) => map.extend(files),
517+
516518
Err(_e) => log::error!(
517519
"Could not read folder: {:?}. Specified in dependency: {}, located {:?}...",
518520
path_dir.to_path_buf().into_os_string(),
519521
package_name,
520522
package_dir
521523
),
522-
}
523-
}
524+
},
525+
};
524526

525527
map
526528
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn main() -> Result<()> {
118118
std::process::exit(1)
119119
}
120120
lock::Lock::Aquired(_) => match command {
121-
Command::Clean => build::clean::clean(&folder, show_progress, args.bsc_path),
121+
Command::Clean => build::clean::clean(&folder, show_progress, args.bsc_path, args.dev),
122122
Command::Build => {
123123
match build::build(
124124
&filter,

0 commit comments

Comments
 (0)