Make sure chosen workspace name is InstaPy friendly
(path)
| 162 | |
| 163 | |
| 164 | def verify_workspace_name(path): |
| 165 | """Make sure chosen workspace name is InstaPy friendly""" |
| 166 | |
| 167 | path = slashen(path) |
| 168 | path = remove_last_slash(path) |
| 169 | custom_workspace_name = path.split("/")[-1] |
| 170 | default_workspace_name = WORKSPACE["name"] |
| 171 | |
| 172 | if default_workspace_name not in custom_workspace_name: |
| 173 | if default_workspace_name.lower() not in custom_workspace_name.lower(): |
| 174 | path += "/{}".format(default_workspace_name) |
| 175 | else: |
| 176 | nicer_name = custom_workspace_name.lower().replace( |
| 177 | default_workspace_name.lower(), default_workspace_name |
| 178 | ) |
| 179 | path = path.replace(custom_workspace_name, nicer_name) |
| 180 | |
| 181 | return path |
| 182 | |
| 183 | |
| 184 | def differ_paths(old, new): |
no test coverage detected