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

Variables/properties not always set correctly #73

Closed
hohwille opened this issue Apr 2, 2019 · 10 comments
Closed

Variables/properties not always set correctly #73

hohwille opened this issue Apr 2, 2019 · 10 comments
Labels
bug Something isn't working scripts related to shell scripts (bash and CMD) windows specific for Microsoft Windows OS
Milestone

Comments

@hohwille
Copy link
Member

hohwille commented Apr 2, 2019

I did run setup.bat on windows and get this error at the end:

*** ATTENTION ***
Your devon-ide is missing the settings at
Please run the following command to complete your IDE setup:

So as it seems SETTINGS_PATH was not set in this scenario.

@hohwille hohwille added bug Something isn't working windows specific for Microsoft Windows OS scripts related to shell scripts (bash and CMD) labels Apr 2, 2019
@hohwille hohwille added this to the release:3.0.0 milestone Apr 2, 2019
@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

Ah, reading the logs I also found:

'load_properties' is not recognized as an internal or external command,
operable program or batch file.

That is the reason for this error.
From the error message this looks like windows and might be originated from environment-project.bat. However, it may also be the case that this comes from the bash script that used the function load_properties after unloading it and then executed this as a regular command in windows.

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

This seems to come from bash and if I am not mistaken it is a combination of some magic optimization in bash when sourcing the functions again whilst having a name clash with load_properties and unloading it.
Hence, I will just rename that function in functions to avoid that the unloading in environment-project can not have undesired side-effects on functions.

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

To avoid a potential name clash I renamed the function. However, this was a wrong guess and is not the reason for the bug. According to my debugging it seems to actually come from environment-project.bat and not from bash:

Completed
win: call load_properties "C:\projects\test-beta3\scripts\devon.properties"
'load_properties' is not recognized as an internal or external command,
operable program or batch file.

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

OMG: Seems I released this but never tested it on win. Call needs to include the colon and not only the label name...

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

OK, this is fixed, but still issues with implementation of #63 :

"MAVEN_OPTS=}=%"
"ECLIPSE_VMARGS=}=%"

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

Funny:

export MAVEN_OPTS="-Xmx512m -Duser.home=${DEVON_IDE_HOME}/conf"

Duplicate equals sign is causing issues with my hacks to parse properties files in bash and win cmd. Need to fix so the first equal sign is considered for matching key=value.

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

OK, windows tokenizing is not only splitting at equals sign but also at whitespace. Also it seems to have issues with quotes. #63 is more tricky than I guessed and it looks like some more work with ugly windows bat hacking that is hard to debug...

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

I removed the quotes and now it is working. If someone has the magic knowledge how to fix the CMD logic so it can deal with quotes this would be a nice improvement. However, *.properties are supposed to be unquoted and this issue is fixed. So I will merge my PR and close this isse.

@hohwille hohwille closed this as completed Apr 2, 2019
hohwille added a commit that referenced this issue Apr 2, 2019
* #55: fix for git
* #73: rename function load_properties to doLoadProperties in functions, fixed bat call to label
* #73: #63: avoid quotes that cause issues on windows
* #45: fixed template for idea.properties
@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

No without the quotes it fails in bash:

(eval):1: no such file or directory: -Duser.home=/projects/ide-test/conf
(eval):1: command not found: -Xmx768M

Shell script hacking is error-prone. With Java coding I know what I am doing. With bash and especially CMD it gets quite tricky in such cases. However, I will find a way to fix it.

@hohwille
Copy link
Member Author

hohwille commented Apr 2, 2019

Hopefully fixed properly now.

@hohwille hohwille closed this as completed Apr 2, 2019
hohwille added a commit that referenced this issue Apr 2, 2019
hohwille added a commit that referenced this issue Apr 2, 2019
* #73: fix for load_properties in bash
* #68: fixed
* #61: allow "devon bash" to open bash on windows
* #61: automatically call devon initialization when bash or zsh is opened
* #69: support uninstall
* #69: fixed quotation, also support upgrade
* #43: doc update
* #64: applied fixes from PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scripts related to shell scripts (bash and CMD) windows specific for Microsoft Windows OS
Projects
None yet
Development

No branches or pull requests

1 participant