Skip to content

Commit

Permalink
feat: add safeguard against overriding existing file
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr <piotrzan@gmail.com>
  • Loading branch information
Piotr1215 committed May 26, 2024
1 parent c7a1d36 commit 6797d94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion killercoda_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,13 @@ def execute_file_operations(file_operations):
os.chmod(operation.path, operation.mode)
elif operation.operation == "rename":
os.rename(operation.path, operation.content)

def init_project():
"""initialize a new project by creting index.json file"""
"""initialize a new project by creating index.json file"""
if os.path.exists("index.json"):
print("The 'index.json' file already exists. Please edit the existing file.")
return

index_data = {
"details": {
"title": "Project Title",
Expand Down

0 comments on commit 6797d94

Please sign in to comment.