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 @@ -728,6 +728,11 @@ std::string filename(std::string path) {
728
728
return basename_r (pathCstr, filename) ? filename : pathCstr;
729
729
}
730
730
731
+ bool directory_exists (const std::string &path) {
732
+ struct stat st;
733
+ return stat (path.c_str (), &st) == 0 && S_ISDIR (st.st_mode );
734
+ }
735
+
731
736
// This executable's own path.
732
737
std::string self_executable = []() -> std::string {
733
738
char path[MAXPATHLEN] = {0 };
@@ -1115,6 +1120,11 @@ int main(int argc, const char *argv[]) {
1115
1120
platform = filename (src_dirs.front ());
1116
1121
}
1117
1122
1123
+ for (const auto &src_dir : src_dirs) {
1124
+ if (!directory_exists (src_dir))
1125
+ fail (" Source directory does not exist: %s" , src_dir.c_str ());
1126
+ }
1127
+
1118
1128
// Add the platform to unsigned_dst_dir if it is not already present.
1119
1129
if (!unsigned_dst_dir.empty ()) {
1120
1130
const auto unsigned_platform = unsigned_dst_dir;
You can’t perform that action at this time.
0 commit comments