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

meta project import modifies .gitignore even with faulty input params #297

Closed
eddex opened this issue Jun 18, 2022 · 1 comment
Closed
Labels

Comments

@eddex
Copy link

eddex commented Jun 18, 2022

🐛 Bug Report

When I run the meta project import command, I often forget to add both dest and repoURL params. Instead I just add one param (usually the repo URL). Meta then proceeds to modify the .gitignore file, then tries to clone the repo but fails, hence not modifying the .meta file. The .gitignore file now contains the git URL, which is not correct.

To Reproduce

Example:

> meta project import [email protected]:eddex/some-repo.git
{ repoUrl: undefined, dest: '[email protected]:eddex\\some-repo.git' }

~\work\meta-repo:
fatal: repository 'undefined' does not exist
~\work\meta-repo: command 'git clone  undefined [email protected]:eddex\some-repo.git' exited with error: Error: Command failed: git clone  undefined [email protected]:eddex\some-repo.git
Appending to ~\work\meta-repo\.gitignore
Updating "projects" in ~\work\meta-repo\.meta

✓ Project imported: [email protected]:eddex\some-repo.git

The only modified file after this command is the .gitignore, meta adds the dest param (which in this case is the git URL):

+/[email protected]:eddex\some-repo.git/

Expected behavior

If only one param is detected (one of them is null/undefined), the command should be aborted and no files should be modified.

Alternatively, it would be great to allow only passing the repoURL and automatically parsing the repo name from it.

@eddex eddex added the bug label Jun 18, 2022
@eddex
Copy link
Author

eddex commented Jun 18, 2022

I just realized that this issue should be opened in the meta-project repo. Opened it here mateodelnorte/meta-project#104 and closing this issue.

@eddex eddex closed this as completed Jun 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant