Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit c1aefaf

Browse files
committed
check for /dev at executable location
1 parent 96738d6 commit c1aefaf

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

appshell/cefclient_gtk.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ static gboolean HandleQuit(int signatl) {
5757
destroy();
5858
}
5959

60+
bool FileExists(std::string path) {
61+
struct stat buf;
62+
return (stat(path.c_str(), &buf) >= 0) && (S_ISREG(buf.st_mode));
63+
}
64+
6065
int GetInitialUrl() {
6166
GtkWidget *dialog;
6267
const char* dialog_title = "Please select the index.html file";
@@ -143,13 +148,16 @@ int main(int argc, char* argv[]) {
143148
}
144149

145150
szInitialUrl = AppGetRunningDirectory();
146-
szInitialUrl.append("/www/index.html");
151+
szInitialUrl.append("/dev/src/index.html");
147152

148-
{
149-
struct stat buf;
150-
if(!(stat(szInitialUrl.c_str(), &buf) >= 0) || !(S_ISREG(buf.st_mode)))
151-
if(GetInitialUrl() < 0)
153+
if (!FileExists(szInitialUrl)) {
154+
szInitialUrl = AppGetRunningDirectory();
155+
szInitialUrl.append("/www/index.html");
156+
157+
if (!FileExists(szInitialUrl)) {
158+
if (GetInitialUrl() < 0)
152159
return 0;
160+
}
153161
}
154162

155163
// Initialize CEF.

0 commit comments

Comments
 (0)