mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 09:24:52 +03:00
minor fixes
This commit is contained in:
parent
486889d08b
commit
ca75dda771
|
@ -45,13 +45,6 @@ def remove_gplv3_files():
|
||||||
os.remove(file_name)
|
os.remove(file_name)
|
||||||
|
|
||||||
|
|
||||||
def remove_vscode_devcontainer_files():
|
|
||||||
dir_paths = [".devcontainer", ".history"]
|
|
||||||
for dir_path in dir_paths:
|
|
||||||
if os.path.exists(dir_path):
|
|
||||||
shutil.rmtree(dir_path)
|
|
||||||
|
|
||||||
|
|
||||||
def remove_pycharm_files():
|
def remove_pycharm_files():
|
||||||
idea_dir_path = ".idea"
|
idea_dir_path = ".idea"
|
||||||
if os.path.exists(idea_dir_path):
|
if os.path.exists(idea_dir_path):
|
||||||
|
@ -65,8 +58,11 @@ def remove_pycharm_files():
|
||||||
def remove_docker_files():
|
def remove_docker_files():
|
||||||
if "{{ cookiecutter.use_vscode_devcontainer }}".lower() == "n":
|
if "{{ cookiecutter.use_vscode_devcontainer }}".lower() == "n":
|
||||||
shutil.rmtree("compose")
|
shutil.rmtree("compose")
|
||||||
|
|
||||||
file_names = ["local.yml", "production.yml", ".dockerignore"]
|
file_names = ["local.yml", "production.yml", ".dockerignore"]
|
||||||
|
else:
|
||||||
|
shutil.rmtree("compose/production")
|
||||||
|
file_names = ["production.yml"]
|
||||||
|
|
||||||
for file_name in file_names:
|
for file_name in file_names:
|
||||||
os.remove(file_name)
|
os.remove(file_name)
|
||||||
|
|
||||||
|
@ -76,6 +72,22 @@ def remove_docker_files():
|
||||||
os.remove(os.path.join(".idea", "runConfigurations", file_name))
|
os.remove(os.path.join(".idea", "runConfigurations", file_name))
|
||||||
|
|
||||||
|
|
||||||
|
def remove_vscode_devcontainer_files():
|
||||||
|
dir_path = ".devcontainer"
|
||||||
|
if os.path.exists(dir_path):
|
||||||
|
shutil.rmtree(dir_path)
|
||||||
|
|
||||||
|
|
||||||
|
def create_vscode_devcontainer_bash_history_file():
|
||||||
|
history_dir_path = ".history"
|
||||||
|
if not os.path.exists(history_dir_path):
|
||||||
|
os.mkdir(history_dir_path)
|
||||||
|
|
||||||
|
history_file_path = ".history/bash_history"
|
||||||
|
with open(history_file_path, 'a'):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def remove_utility_files():
|
def remove_utility_files():
|
||||||
shutil.rmtree("utility")
|
shutil.rmtree("utility")
|
||||||
|
|
||||||
|
@ -460,6 +472,8 @@ def main():
|
||||||
|
|
||||||
if "{{ cookiecutter.use_vscode_devcontainer }}".lower() == "n":
|
if "{{ cookiecutter.use_vscode_devcontainer }}".lower() == "n":
|
||||||
remove_vscode_devcontainer_files()
|
remove_vscode_devcontainer_files()
|
||||||
|
else:
|
||||||
|
create_vscode_devcontainer_bash_history_file()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
"{{ cookiecutter.use_docker }}".lower() == "y"
|
"{{ cookiecutter.use_docker }}".lower() == "y"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user