summaryrefslogtreecommitdiff
path: root/overrides
diff options
context:
space:
mode:
authorMatt Watson <mattdangerw@gmail.com>2014-04-03 11:08:30 -0700
committerMatt Watson <mattdangerw@gmail.com>2014-04-03 11:08:30 -0700
commit505fd25d92cf81d1d54a5de942b4f7a155d42e2a (patch)
treede8bf2925c739fd9c9b7f8c3fd7d931038dead96 /overrides
parent4b7d26a6a0c67e8a197da271b5ede86c6fa30b75 (diff)
getCurrentFileDir follows symlinks
Will return the actual dir of the real file calling, instead of the linked location. [endlessm/eos-sdk#873]
Diffstat (limited to 'overrides')
-rw-r--r--overrides/Endless.js4
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();