Improved new command to use workspace when found

This commit is contained in:
2021-04-09 22:09:55 +02:00
parent d19c47e571
commit 7ad01d4bdd
8 changed files with 105 additions and 59 deletions

View File

@@ -16,7 +16,7 @@ class String:
pattern1 = re.compile(r'(.)([A-Z][a-z]+)')
pattern2 = re.compile(r'([a-z0-9])([A-Z])')
file_name = re.sub(pattern1, r'\1_\2', name)
return re.sub(pattern2, r'\1_\2', file_name).lower()
return re.sub(pattern2, r'\1_\2', file_name).lower().replace('-', '_')
@staticmethod
def first_to_upper(string: str) -> str: