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

$FileDir$ path is giving wrong path in the command #19

Open
GonzaloCalandria opened this issue Jan 25, 2019 · 22 comments
Open

$FileDir$ path is giving wrong path in the command #19

GonzaloCalandria opened this issue Jan 25, 2019 · 22 comments
Labels
bug waiting for response Waiting for a response from the reporter(s)

Comments

@GonzaloCalandria
Copy link

GonzaloCalandria commented Jan 25, 2019

I'm trying to use repo with intellij but the path is wrong.
This is what I have so far:

  • Repo installation: C:\Repo
  • Cygwin installation: C:\cygwin64
    My task configuration
    image

The output for one of the tasks is:
repo: not inside a vault checkout with a jcr_root base directory: /home/phoenix/C:\MyProject\packages\my-application\src\main\content\jcr_root\apps\myapp\components\authoring\hero\clientlibs\js.txt

I don't understand why is adding /home/phoenix/ to the path.

@alexkli
Copy link
Contributor

alexkli commented Jan 28, 2019

I don't use it on Windows. @mkovacek provided the Windows/cygwin instructions in the readme once. Does it still work for you with the latest repo 1.4?

@yakulto
Copy link

yakulto commented Jun 17, 2019

@GonzaloCalandria in case you're still having this issue, I find that selecting individual files will throw this error. Selecting the folder containing the file won't

@alexkli
Copy link
Contributor

alexkli commented Jul 22, 2019

@GonzaloCalandria Let me know if you still have the problem with 1.4. Also we have a contribution with Powershell support coming in, maybe that fixes the issue.

@alexkli
Copy link
Contributor

alexkli commented Jul 23, 2019

@GonzaloCalandria this might simply be because IntelliJ passes a windows-style path to repo, such as c:\some\dir, while repo strictly expects unix-style paths, such as /some/dir.

Could you try the same command manually, but with the backslashes converted to slashes?

@GonzaloCalandria
Copy link
Author

@alexkli sorry to not answered this before.
I've tested using a cygwin path along with the file relative path like this
-l C:\RepoTool\repo\repo diff /cygdrive/c/demo-project/spa-demo/$/FileRelativePath$
And I got this error when I run diff (I'm testing this with diff).

C:\cygwin64\bin\bash -l C:\RepoTool\repo\repo diff /cygdrive/c/demo-project/spa-demo/ui.apps/src/main/content/jcr_root/apps/spa_demo/components/card/_cq_dialog.xml
mktemp: failed to create directory via template ‘/cygdrive/c/Users/Public/Documents/Wondershare/CreatorTemp/repo.XXX’: No such file or directory
C:\RepoTool\repo\repo: line 354: cannot create temp file for here-document: No such file or directory
C:\RepoTool\repo\repo: line 334: cannot create temp file for here-document: No such file or directory
C:\RepoTool\repo\repo: line 341: cannot create temp file for here-document: No such file or directory
curl: (26) Failed to open/read local data from file/application
repo: failed to upload package: 

Process finished with exit code 5

@GonzaloCalandria
Copy link
Author

Ok... I make it work.. kind off...
but I've used Windows 10 bash instead of cygwin with a few changes.
Here's what I've changed:
Just FYI, this is for IntelliJ and for the diff External Tool

  • For Tool Settings: C:\Windows\System32\bash.exe
  • For Arguments: /mnt/c/RepoTool/repo/repo diff /mnt/c/demo-project/spa-demo/$/FileRelativePath$ Where /mnt/c/RepoTool/repo/repo is the full path to the repo tool file (I think here you can have the path added to $PATH$ in windows bash system) and /mnt/c/demo-project/spa-demo/ is the root path to my project that I had to hardcode to make it work.

If there's some alternative to include the whole path (in Linux format with the proper slashes and path) would be great!

CC: @alexkli

@karthikgoli
Copy link

karthikgoli commented Nov 19, 2019

@GonzaloCalandria

I have faced same issue, where path is appending incorrect in IntelIij. I have tried bash approach as above, but however i am facing below issue. Please let me know if you have faced below issue and any workaround for this issue.

uploading <Path of file in project>to http://localhost:4502 /mnt/c/Softwares/tools-repo-1.4/repo/repo: line 381: zip: command not found /mnt/c/Softwares/tools-repo-1.4/repo/repo: line 679: unzip: command not found curl: (3) Illegal characters found in URL repo: failed to upload package:

Thank you
Karthik

@GonzaloCalandria
Copy link
Author

@GonzaloCalandria

I have faced same issue, where path is appending incorrect in IntelIij. I have tried bash approach as above, but however i am facing below issue. Please let me know if you have faced below issue and any workaround for this issue.

uploading <Path of file in project>to http://localhost:4502 /mnt/c/Softwares/tools-repo-1.4/repo/repo: line 381: zip: command not found /mnt/c/Softwares/tools-repo-1.4/repo/repo: line 679: unzip: command not found curl: (3) Illegal characters found in URL repo: failed to upload package:

Thank you
Karthik

I think your problem is that you don't have zip and unzip installed in bash. Maybe you can try installing those two commands?

@karthikgoli
Copy link

@GonzaloCalandria

Thank you for your response, installing zip in bash has resolved this issue.

The only issue i have now is in Intellij when i try PUT i have this error
curl: (3) Illegal characters found in URL repo: failed to upload package
However, when i try PUT from bash console it is working fine.

Any suggestion for this issue

@GonzaloCalandria
Copy link
Author

@GonzaloCalandria

Thank you for your response, installing zip in bash has resolved this issue.

The only issue i have now is in Intellij when i try PUT i have this error
curl: (3) Illegal characters found in URL repo: failed to upload package
However, when i try PUT from bash console it is working fine.

Any suggestion for this issue

I don't have any for that.. sorry.
My only guess is that maybe you can try putting quotes between the path in the configuration of the repo tool?

@karthikgoli
Copy link

@GonzaloCalandria thank you for your response

@GonzaloCalandria
Copy link
Author

@GonzaloCalandria thank you for your response

Did it worked?

@karthikgoli
Copy link

@GonzaloCalandria No, i am still checking on it

@sibim
Copy link

sibim commented Dec 3, 2019

Hi All,

I have my local instance in port 4506. But if I configure .repo file under my parent project with the required details and running repo in IntelliJ in windows 10 is not taking the repository information with port 4506, it is trying for some time for 4502 and failing.

Configuring directly 4506 with required details in is working fine. From .repo it is not taking th eport details.

@lflondonol92
Copy link
Contributor

lflondonol92 commented Apr 14, 2021

I made it work without hardcoding the root path by using -l repo diff -f "$UnixSeparators($FilePath$)$" as the argument. UnixSeparators converts the path from Windows format to Unix format.

Maybe the documentation for Windows should be updated with this.

@GonzaloCalandria
Copy link
Author

@felipel1292 Could you please share a screenshot of the full configuration?

@lflondonol92
Copy link
Contributor

@felipel1292 Could you please share a screenshot of the full configuration?

Sure
image

@GonzaloCalandria
Copy link
Author

GonzaloCalandria commented Sep 8, 2022

Hello everyone, I'm trully sorry for not answering this before.
Having @felipel1292 's configuration, didn't worked for me.. it tries to perform the command against a path of the style c:/myproject/..... and it says the file was not found.
I've tried using -l repo put -f "$UnixSeparators($FileRelativePath$)$" (FileRelativePath instead of FilePath) and that seems to be working but now the problem I'm having is the following:
image
Just FYI.. my AEM instance is up and running (in port 4502)

@feolinaresm
Copy link

@felipel1292 Does it still works for you? I changed it as you suggested but same result, I appeciate any updates from you.

@awesomecondor
Copy link

repo: failed to upload package:
I am getting this after all configuration has been done.
Any idea??

@Sivasai897
Copy link

It was resolved for me by removing the .exe extension from C:/cygwin64/bin/bash.exe and replacing it with C:\cygwin64\bin\bash. After that, ensure that Cygwin has the latest versions of packages zip, unzip, curl, and RSYNC installed. My issue was resolved after I tried this solution.

@ravrockss
Copy link

It was resolved for me by removing the .exe extension from C:/cygwin64/bin/bash.exe and replacing it with C:\cygwin64\bin\bash. After that, ensure that Cygwin has the latest versions of packages zip, unzip, curl, and RSYNC installed. My issue was resolved after I tried this solution.

This solves the issue. Confirmed with Windows, Cygwin and IntelliJ 2023 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug waiting for response Waiting for a response from the reporter(s)
Projects
None yet
Development

No branches or pull requests

10 participants