Closed pwalczysko closed 5 years ago
Looks as I would have thought.
To be fair, I do not completely understand the second else if with the target inside the path - do not see the target defined in that file.
I think this is only the case when you are building the downloader from source.
@joshmoore Added testing steps into description, hope this is as expected (mainly the test 2. where I am trying to mock the structure with the target
folder).
I'm concerned about the case where the %JAR_FILE%
needs quoting. Perhaps that's too unlikely though even if it regains version numbering in its name: for some reason what should be easy is not easy enough to be worth it.
Update: Sorry, should have woken up more first, obviously I misread the diff: you can ignore this comment. :smiley:
For (2) one can just git clone --depth 1
the repo and use the mvn
from the test scenario. Doesn't help if your Windows doesn't have devtools installed, admittedly.
Does the quoting in the if
conditions require a similar fix?
Testing: should also include running download.bat
from a directory the path to which actually requires quoting. For example, I can type,
$ foo\ \'\ bar/OMERO.downloader-0.1.2/download.sh ...
and it works. (I originally downloaded the artifact from within the directory /tmp/foo ' bar/
.)
I suppose I have to replace the bat in the release with the one from the PR right?
Tested on Windows 10. With the bat from this PR:
👍
"Cannot create repository links":
-l none
fix it?Yes, both works @mtbc .
:+1: Thank you, it turns out that link-making is an extra special privilege for Windows users! At least we finally have a motivator for the -l
option. Noted https://trello.com/c/pXVR5Vyd/56-adapt-to-inability-to-create-symlinks.
Does the quoting in the if conditions require a similar fix?
It works without it, and I do not know why.
A bit confused what are the ToDos here.
@mtbc @dominikl ?
Definitely something like https://github.com/ome/omero-downloader/pull/6#issuecomment-458046323 at least but @dominikl may have done that already: i.e. something that needs the quoting.
It works without it, and I do not know why.
Maybe move them anyway to keep it all looking the same? Seems to work either way then readers may be less confused about why there's a difference.
something that needs the quoting
In my testing with Windows Server 2008 (TS-OME-DEV) using paths with spaces in them, this PR's fix does seem to work.
I suppose the test https://github.com/ome/omero-downloader/pull/6#issuecomment-458540485 is covering the task https://github.com/ome/omero-downloader/pull/6#issuecomment-458452600 ?
The last commit should cover the comment https://github.com/ome/omero-downloader/pull/6#issuecomment-458540051
Maybe merge then ?
This should suggest a fix of the
download.bat
script on Windows. The suggested fix is inspired by @joshmoore 's comment pointing to https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/bin/omero.batSee trello card.
This fix works for me as tested on Windows 7 laptop. Admittedly, I think that I am always testing just the first
if
case, namely, when mydownload.bat
is in the same dir as the jar. But then, I guess this is the more common case. To be fair, I do not completely understand the secondelse if
with thetarget
inside the path - do not see thetarget
defined in that file.See what you think
@joshmoore @mtbc
To test:
1.
download.bat
is.download.bat -b <path-to-directory-you-just-created> -s <server host> -u <user name> -w <password> -f binary Image:<image ID>
2.
download.bat
called "target" and move thedownloader-jar-with-dependencies.jar
into the directory you just created.downloader-jar-with-dependencies.jar
to some other directory than the two dirs described in step 1. and 2. above, or delete it.Failed to find JAR file named downloader-jar-with-dependencies.jar