code: function getProgramDir(programFile) {
      const info = programFile.query_info('standard::', Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null);
      if (info.get_is_symlink()) {
        const symlinkFile = programFile.get_parent().resolve_relative_path(info.get_symlink_target());
        return symlinkFile.get_parent();
      } else {
        return programFile.get_parent();
      }
    }
docs: basic utility for this scope