refine.bat file for Windows causing missing label now

Skip to first unread message

Thad Guidry

Jul 29, 2021, 8:32:35 PMJul 29
I got stuck trying to build 4.0 branch and it seems its not working...well refine.bat is complaining.

and simply changing the line endings on refine.bat seems to have fixed the problem!?!?!

E:\GitHubRepos\OpenRefine>refine clean
Using refine.ini for configuration
The system cannot find the batch label specified - endArgumentParsing

E:\GitHubRepos\OpenRefine>refine clean
Using refine.ini for configuration
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] OpenRefine                                                         [pom]
[INFO] OpenRefine - utilities                                             [jar]

Hmm, I often just git checkout as-is and always commit with Unix (LF) (I even have my git config setup with this as most other Windows open source developers do)

Normally on Windows dev machines this wouldn't be an issue at all.
Windows can easily deal with Unix (LF) endings nowadays, but apparently not always the Windows batch file "label scanner" that does part of the parsing for batch files !!!

So it seems I just hit upon this issue against 512 byte chunks with Windows batch file label scanner where a label is at the 512 byte

How might we best address this without forcing the refine.bat file to be stored and locked with Windows (CR LF) endings?

Perhaps just adding another rem line right before the Argument setting?

rem --- Set Arguments ----------------------------------------------

if ""%1"" == ""/m"" goto arg-m
if ""%1"" == ""/x"" goto arg-x
goto endArgumentParsing

rem --- Set Arguments ----------------------------------------------

goto shift2loop

goto shift2loop

Thad Guidry

Jul 29, 2021, 8:46:12 PMJul 29
OK, seems like shifting with a rem statement does work.

Probably also could add it to master branch?

Reply all
Reply to author
0 new messages