diff options
author | P. F. Chimento <philip.chimento@gmail.com> | 2014-04-03 14:19:13 -0700 |
---|---|---|
committer | P. F. Chimento <philip.chimento@gmail.com> | 2014-04-03 14:19:13 -0700 |
commit | 4120612ce88aa09de995e3acb584ddbf59a7ae7e (patch) | |
tree | 1e53be1362e3e897dd5ca8d5bdd99b8da6b0b288 | |
parent | 45f759347dcc433aa968a075f49015745549ecbc (diff) | |
parent | 505fd25d92cf81d1d54a5de942b4f7a155d42e2a (diff) |
Merge pull request #876 from endlessm/sdk/873
getCurrentFileDir follows symlinks
[endlessm/eos-sdk#873]
-rw-r--r-- | overrides/Endless.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/overrides/Endless.js b/overrides/Endless.js index 7f1d0a5..60a42e7 100644 --- a/overrides/Endless.js +++ b/overrides/Endless.js @@ -1,3 +1,4 @@ +const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; let Endless; @@ -9,6 +10,9 @@ function getCurrentFileDir() { let caller = e.stack.split('\n')[1]; let pathAndLine = caller.split('@')[1]; let path = pathAndLine.split(':')[0]; + while (GLib.file_test(path, GLib.FileTest.IS_SYMLINK)) { + path = GLib.file_read_link(path); + } // Get full path from GIO return Gio.File.new_for_path(path).get_parent().get_path(); |