@classmethod
def to_os_independent_path(cls, path):
    """Replaces the part of the given path with repository environment
        variable which makes the given path OS independent.

        :param path: path to make OS independent
        :return:
        """
    repo = cls.find_repo(path)
    if repo:
        return '$%s/%s' % (repo.env_var, repo.make_relative(path))
    else:
        return path
