forked from twoscoops/django-twoscoops-project
-
Notifications
You must be signed in to change notification settings - Fork 44
/
tasks.py
38 lines (25 loc) · 1016 Bytes
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from invoke import task, run
from os.path import dirname, abspath
# Create scripted tasks to run in command-line here
# http://docs.pyinvoke.org/en/latest/
PROJECT_ROOT = '%s/{{ project_name }}' % dirname(abspath(__file__))
@task
def clean():
"""Clean up static, compiled, test, and log files"""
print("Deleting *.pyc files...")
run('find . -name *.pyc -delete')
print("Deleting collected static files...")
run('rm -rf %s/public' % PROJECT_ROOT)
print("Deleting compiled stylesheets...")
run('rm -rf %s/static/css/build' % PROJECT_ROOT)
print("Deleting compiled scripts...")
run('rm -rf %s/static/js/build' % PROJECT_ROOT)
run('rm -rf %s/static/js/tests/build' % PROJECT_ROOT)
print('Deleting compressed images...')
run('rm -rf %s/static/img/compressed' % PROJECT_ROOT)
print('Deleting test files...')
run('rm -rf tests/*')
run('rm -rf .coverage')
run('rm -rf _SpecRunner.html')
print('Deleting log files...')
run('rm -rf logs/*')