Skip to content

Commit

Permalink
revert file validator
Browse files Browse the repository at this point in the history
  • Loading branch information
12944qwerty committed Sep 28, 2023
1 parent fd62ddd commit e121fb6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pros/conductor/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from enum import Enum
from pathlib import Path
from typing import *
import re

import click
from semantic_version import Spec, Version
Expand Down Expand Up @@ -295,8 +294,11 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro

if Path(path).exists() and Path(path).samefile(os.path.expanduser('~')):
raise dont_send(ValueError('Will not create a project in user home directory'))
if re.match(r'^[\w\-. /]+$', str(Path(path))) is None:
raise dont_send(ValueError('Invalid characters found in path'))
for char in str(Path(path)):
if char in ['?', '<', '>', '*', '|', '^', '#', '%', '&', '$', '+', '!', '`', '\'', '=',
'@', '\'', '{', '}', '[', ']', '(', ')', '~'] or ord(char) > 127:
raise dont_send(ValueError(f'Invalid character found in directory name: \'{char}\''))

proj = Project(path=path, create=True)
if 'target' in kwargs:
proj.target = kwargs['target']
Expand Down

0 comments on commit e121fb6

Please sign in to comment.