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
throwruntime_error("No ProjectVersion.txt found at " + p_as_fs.string() + "\n\nEnsure the folder you selected is the root folder of a complete Unity project.");
466
+
if (filesystem::exists(projSettings)){
467
+
//the first line of ProjectVersion.txt contains the editor verison as plain text
468
+
ifstream inFile;
469
+
inFile.open(projSettings);
470
+
getline(inFile, version);
471
+
version = version.substr(17);
486
472
}
487
473
488
-
//the first line of ProjectVersion.txt contains the editor verison as plain text
489
-
string version;
490
-
ifstream inFile;
491
-
inFile.open(projSettings);
492
-
getline(inFile,version);
493
-
version = version.substr(17);
494
-
495
474
//get the modification date
496
-
structstat fileInfo;
497
-
if (stat(p_as_fs.string().c_str(), &fileInfo) != 0) {
498
-
throwruntime_error("Cannot get modification date. Ensure this program has access to "+p_as_fs.string());
475
+
string modifyDate;
476
+
structstat fileInfo {};
477
+
if (filesystem::exists(p_as_fs)) {
478
+
if (stat(p_as_fs.string().c_str(), &fileInfo) == 0) {
479
+
modifyDate = ctime(&fileInfo.st_mtime);
480
+
}
499
481
}
500
482
501
-
project p = {name,version,ctime(&fileInfo.st_mtime),p_as_fs,};
0 commit comments