Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed-incorrect-template-path-handling #438

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lokesh-6
Copy link

🚀Fixes #437 Corrected start-project Command to Handle Template Path Properly

🔍 Issue Description

The zango start-project command was failing due to incorrect template path handling when executing the subprocess.run command. The issue was caused by inconsistent path formatting, particularly when running on Windows, where single quotes (') around the template path were causing execution errors.

⚠️ Root Cause

The original implementation:

command = f"{command} --template '{str(project_template_path)}'"
subprocess.run(command, shell=True, check=True)
  • Problem: On Windows, using single quotes (') around paths in shell commands can cause errors.

  • Expected Behavior: The command should execute correctly regardless of the operating system.

✅ Solution

The fix ensures proper path formatting by replacing single quotes with double quotes ("), making it compatible with both Windows and Unix-based systems:

command = f'{command} --template "{project_template_path}"'
subprocess.run(command, shell=True, check=True)
  • Why This Works?

    • Windows expects double quotes for file paths in shell commands.

    • Unix-based systems (Linux/macOS) work with both single and double quotes but handle escaping differently.

    • This change improves cross-platform compatibility and ensures the command runs as expected.

🛠️ Changes Made

  • Updated: start_project.py to properly format the --template path.

  • Ensured Compatibility: Works correctly across Windows, Linux, and macOS.

  • Tested: Successfully executed zango start-project "MyProject" without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zango start-project fails due to incorrect template path handling
1 participant