Permalink
Browse files

Relaunch 96112f4 with fix for Mac.

  • Loading branch information...
zcbenz committed Dec 14, 2012
1 parent 62ab94f commit 60ff4cf5067cbcc829f984d2a761fda5fa3c3d20
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/nw_package.cc
View
@@ -118,9 +118,17 @@ Package::Package()
if (args.size() > 0) {
self_extract_ = false;
path_ = FilePath(args[0]);
- if (InitFromPath())
- return;
+ } else {
+ // Try to load from the folder where the exe resides.
+ // Note: self_extract_ is true here, otherwise a 'Invalid Package' error
+ // would be triggered.
+ path_ = GetSelfPath().DirName();
+#if defined(OS_MACOSX)
+ path_ = path_.DirName().DirName().DirName();
+#endif
}
+ if (InitFromPath())
+ return;
// Finally we init with default settings.
self_extract_ = false;

1 comment on commit 60ff4cf

Member

rogerwang commented on 60ff4cf Dec 14, 2012

the code can get more confusing easily when the logic becomes more complex. One of the reason is that those member functions acts upon member fields rather than function arguments. We'd refactor this in the future.

Please sign in to comment.