File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -723,6 +723,11 @@ std::string filename(std::string path) {
723
723
return basename_r (pathCstr, filename) ? filename : pathCstr;
724
724
}
725
725
726
+ bool directory_exists (const std::string &path) {
727
+ struct stat st;
728
+ return stat (path.c_str (), &st) == 0 && S_ISDIR (st.st_mode );
729
+ }
730
+
726
731
// This executable's own path.
727
732
std::string self_executable = []() -> std::string {
728
733
char path[MAXPATHLEN] = {0 };
@@ -1110,6 +1115,11 @@ int main(int argc, const char *argv[]) {
1110
1115
platform = filename (src_dirs.front ());
1111
1116
}
1112
1117
1118
+ for (const auto &src_dir : src_dirs) {
1119
+ if (!directory_exists (src_dir))
1120
+ fail (" Source directory does not exist: %s" , src_dir.c_str ());
1121
+ }
1122
+
1113
1123
// Add the platform to unsigned_dst_dir if it is not already present.
1114
1124
if (!unsigned_dst_dir.empty ()) {
1115
1125
const auto unsigned_platform = unsigned_dst_dir;
You can’t perform that action at this time.
0 commit comments