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) {
723723 return basename_r (pathCstr, filename) ? filename : pathCstr;
724724}
725725
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+
726731// This executable's own path.
727732std::string self_executable = []() -> std::string {
728733 char path[MAXPATHLEN] = {0 };
@@ -1110,6 +1115,11 @@ int main(int argc, const char *argv[]) {
11101115 platform = filename (src_dirs.front ());
11111116 }
11121117
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+
11131123 // Add the platform to unsigned_dst_dir if it is not already present.
11141124 if (!unsigned_dst_dir.empty ()) {
11151125 const auto unsigned_platform = unsigned_dst_dir;
You can’t perform that action at this time.
0 commit comments