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

Windows directories are troublesome for repoman exec #20

Closed
andreashouben opened this issue Jan 27, 2016 · 6 comments
Closed

Windows directories are troublesome for repoman exec #20

andreashouben opened this issue Jan 27, 2016 · 6 comments

Comments

@andreashouben
Copy link
Contributor

It appears that you can't use repoman exec with windows.

Simple example:

Assume you have the following structure:

D:\workspace\project-a
D:\workspace\project-b

The .repoman.jsoncan be found under D:\workspace.

If you execute from there repoman exec 'dir' you get as result:

+ project-a
The system cannot find the path specified.

+ project-b
The system cannot find the path specified.

If you execute repoman exec 'cd {workspace}' -v you get as result:

+ project-a
> cd W:\workspace
The filename, directory name, or volume label syntax is incorrect.

+ project-b
> cd W:\workspace
The filename, directory name, or volume label syntax is incorrect.

I assume repoman as trouble with the windows backslash. Would be great if that could be fixed :)

@basti1302
Copy link
Owner

Hey Andreas,

thanks for the detailed report. Do you have a pull request for me? 😇

basti1302 added a commit that referenced this issue Jan 28, 2016
@andreashouben
Copy link
Contributor Author

Oh you rascal. 😛
Well, apparently you already commited a fix. I'd like to try that out soon. How do I use the latest... is there such a thing as snapshots here?

@basti1302
Copy link
Owner

No, the fix is not enough. The command for repoman exec is processed with some rather exotic string templating engine and it appers this engine does not play nicely with backslashes. I'll replace it with something else and try again. I'll let you know if I have something you can test.

@andreashouben
Copy link
Contributor Author

Another note: Maybe it's not even necessary to replace the slash with a backslash. Usually I am using git bash to execute repoman under windows, where i knew it's possible to use slashes. But even the windows cmd knows how to interpret slashes.
Although there you have to explicitly change the drive first.
Examples:
Screenshot git bash
Screenshot cmd

basti1302 added a commit that referenced this issue Jan 30, 2016
basti1302 added a commit that referenced this issue Jan 30, 2016
This makes repoman exec work on Windows. It makes also sense for *nix
OSes so that the command is only executed when the directory change
succeeds.

closes #20
basti1302 added a commit that referenced this issue Jan 30, 2016
- Replace pathseparator in commands with system dependent
  character
- Use && instead of ; as separator for multiple commands in one line.
  This makes repoman exec work on Windows. It makes also sense for *nix
  OSes so that the command is only executed when the directory change
  succeeds.

closes #20
@basti1302
Copy link
Owner

This should be fixed in 1.0.0.

For the record, the main problem was not the path separator (/ versus \) but that repoman constructed something like cd W:\workspace\repository-name; dir and the ; can not be used to separate multiple commands on one line in Windows, thus the whole of "W:\workspace\repository-name; dir" was interpreted as a directory name.

I did not do anything for the change-the-drive issue. I believe situations where .repoman.json is on a different drive than the individual repositories are very rare, if this can occur at all. This would warrant a separate issue.

@andreashouben
Copy link
Contributor Author

\o/

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

No branches or pull requests

2 participants