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) {
728728 return basename_r (pathCstr, filename) ? filename : pathCstr;
729729}
730730
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+
731736// This executable's own path.
732737std::string self_executable = []() -> std::string {
733738 char path[MAXPATHLEN] = {0 };
@@ -1115,6 +1120,11 @@ int main(int argc, const char *argv[]) {
11151120 platform = filename (src_dirs.front ());
11161121 }
11171122
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+
11181128 // Add the platform to unsigned_dst_dir if it is not already present.
11191129 if (!unsigned_dst_dir.empty ()) {
11201130 const auto unsigned_platform = unsigned_dst_dir;
You can’t perform that action at this time.
0 commit comments