(path_name)
| 137 | |
| 138 | |
| 139 | def is_valid_abspath(path_name): |
| 140 | # Any path that is underneath the emscripten repository root must be ok. |
| 141 | if utils.normalize_path(path_name).startswith(utils.normalize_path(utils.path_from_root())): |
| 142 | return True |
| 143 | |
| 144 | def in_directory(root, child): |
| 145 | # make both path absolute |
| 146 | root = os.path.realpath(root) |
| 147 | child = os.path.realpath(child) |
| 148 | |
| 149 | # return true, if the common prefix of both is equal to directory |
| 150 | # e.g. /a/b/c/d.rst and directory is /a/b, the common prefix is /a/b |
| 151 | return os.path.commonpath([root, child]) == root |
| 152 | |
| 153 | for valid_abspath in options.valid_abspaths: |
| 154 | if in_directory(valid_abspath, path_name): |
| 155 | return True |
| 156 | return False |
| 157 | |
| 158 | |
| 159 | def is_dash_s_for_emcc(args, i): |
no test coverage detected