You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if !read_entire_dir(folder_path,&mut children){returnNone;}
25
27
26
28
for i in0..children.count{
27
29
let child = *children.items.add(i);
28
30
if*child == '.'asc_char{continue;}
29
-
if !copy_file(
30
-
temp_sprintf(c!("%s/%s"), folder_path, child),
31
-
temp_sprintf(c!("./build/libb/%s"), child),
32
-
){returnNone;}
31
+
let child_path = temp_sprintf(c!("%s/%s"), folder_path, child);
32
+
iftemp_strip_suffix(child,c!(".b")).is_none(){
33
+
log(Log_Level::INFO,c!("%s does not end with `.b`. Ignoring..."), child_path);
34
+
continue;
35
+
}
36
+
if !matches!(get_file_type(child_path)?,File_Type::REGULAR){
37
+
log(Log_Level::INFO,c!("%s is not a regular file. Ignoring..."), child_path);
38
+
continue;
39
+
}
40
+
let dest_path = temp_sprintf(c!("%s%s"),BUILD_LIBB_PATH, child);
41
+
iffile_exists(dest_path)? {
42
+
// TODO: track which codegen provides which file and report the offender more precisely
43
+
log(Log_Level::ERROR,c!("%s already exists. Several codegens provide a libb file with the same name."), dest_path);
44
+
returnNone;
45
+
}
46
+
if !copy_file(child_path, dest_path,){returnNone;}
47
+
}
48
+
Some(())
49
+
}
50
+
51
+
pubunsafefnreset_libb() -> Option<()>{
52
+
if !mkdir_if_not_exists(BUILD_LIBB_PATH){returnNone;}
53
+
54
+
letmut children:File_Paths = zeroed();
55
+
56
+
let folder_path = BUILD_LIBB_PATH;
57
+
if !read_entire_dir(folder_path,&mut children){returnNone;}
58
+
59
+
for i in0..children.count{
60
+
let child = *children.items.add(i);
61
+
ifstrcmp(child,c!(".")) == 0{continue;}
62
+
ifstrcmp(child,c!("..")) == 0{continue;}
63
+
let child_path = temp_sprintf(c!("%s/%s"), folder_path, child);
64
+
if !matches!(get_file_type(child_path)?,File_Type::REGULAR){
65
+
log(Log_Level::ERROR,c!("%s contains a non-regular file %s. This is not allowed. Please remove %s manually and trying building the project again."), folder_path, child_path, folder_path);
0 commit comments