mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-30 09:49:46 +03:00
post_gen_project.py - cleanning
This commit is contained in:
parent
3a64ba6dc4
commit
79499dbd3b
|
@ -4,36 +4,8 @@ import shutil
|
|||
|
||||
project_directory = os.path.realpath(os.path.curdir)
|
||||
|
||||
def clean(items):
|
||||
for item in items:
|
||||
path = os.path.join(project_directory, item)
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
os.remove(path)
|
||||
|
||||
pycharm_files = [
|
||||
'.idea/',
|
||||
]
|
||||
|
||||
pycharm_docker_files = [
|
||||
'.idea/Docker__createsuperuser.xml',
|
||||
'.idea/Docker__grunt_build.xml',
|
||||
'.idea/Docker__grunt_compass.xml',
|
||||
'.idea/Docker__grunt_serve.xml',
|
||||
'.idea/Docker__grunt_start_email_server.xml',
|
||||
'.idea/Docker__grunt_stop_email_server.xml',
|
||||
'.idea/Docker__grunt_watch.xml',
|
||||
'.idea/Docker__migrate.xml',
|
||||
'.idea/Docker__runserver_plus.xml',
|
||||
'.idea/Docker__runserver.xml',
|
||||
'.idea/Docker__tests___all.xml',
|
||||
'.idea/Docker__tests___class__TestUser.xml',
|
||||
'.idea/Docker__tests___file__test_models.xml',
|
||||
'.idea/Docker__tests___module__users.xml',
|
||||
'.idea/Docker__tests___specific__test_get_absolute_url.xml',
|
||||
'.idea/Docker__tests___users.xml',
|
||||
]
|
||||
|
||||
if '{{cookiecutter.use_pycharm}}' != 'y':
|
||||
clean(pycharm_files)
|
||||
shutil.rmtree(os.path.join(project_directory, '.idea/'))
|
||||
|
||||
docker_private_key = 'compose/debug/keys_to_docker/id_rsa'
|
||||
os.chmod(os.path.join(project_directory, docker_private_key), 0600)
|
||||
|
|
Loading…
Reference in New Issue
Block a user