function stripTrailingSlash(path) {
        if (path && path[path.length - 1] === "/") {
            return path.slice(0, -1);
        } else {
            return path;
        }
    }
Removes the trailing slash from a path, if it has one.
Warning: this differs from the format of most paths used in Brackets! Use paths ending in "/"
normally, as this is the format used by Directory.fullPath.

@param {string} path
@return {string}