We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
utils
1 parent 3abef1b commit 9d938d4Copy full SHA for 9d938d4
aishell/utils/__init__.py
@@ -0,0 +1 @@
1
+from .make_executable_command import make_executable_command as make_executable_command
aishell/utils/make_executable_command.py
@@ -0,0 +1,14 @@
+def make_executable_command(command: str) -> str:
2
+ # starting '\n' or trailing '\n' should be replaced as ''
3
+ # starting ' ' or trailing ' ' should be replaced as ''
4
+ if command.startswith('\n'):
5
+ command = command[1:]
6
+ if command.endswith('\n'):
7
+ command = command[:-1]
8
+ if command.startswith('`'):
9
10
+ if command.endswith('`'):
11
12
+ command = command.strip()
13
+ command = command.split('User: ')[0]
14
+ return command
0 commit comments