We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0cc392 commit 1680244Copy full SHA for 1680244
perke/cli/clear.py
@@ -0,0 +1,26 @@
1
+import os
2
+from os.path import dirname, join
3
+
4
+import typer
5
6
+from perke.cli.base import app
7
8
9
+@app.command('clear')
10
+def clear_command() -> None:
11
+ """
12
+ Clears the resources directory.
13
14
+ clear()
15
16
17
+def clear() -> None:
18
19
+ Function version of `clear_command` to be available in the package.
20
21
+ resources_path = join(dirname(dirname(__file__)), 'resources')
22
+ for file_name in os.listdir(resources_path):
23
+ if file_name != 'README.md':
24
+ file_path = join(resources_path, file_name)
25
+ os.remove(file_path)
26
+ typer.echo(f'{file_name} removed.')
0 commit comments