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

variable from devon.properties not set if not terminated with newline #394

Closed
hohwille opened this issue Apr 3, 2020 · 3 comments · Fixed by #404
Closed

variable from devon.properties not set if not terminated with newline #394

hohwille opened this issue Apr 3, 2020 · 3 comments · Fixed by #404
Labels
bug Something isn't working windows specific for Microsoft Windows OS

Comments

@hohwille
Copy link
Member

hohwille commented Apr 3, 2020

Expected behavior

When I set variables in devon.properties they should properly apply when devon command was called.

Actual behavior

When the variable is defined in the last line of devon.properties and the file does not end with a newline, the variable is not considered/set.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. edit conf/devon.properties
  2. as last line enter KEY=value (without any newline)
  3. open shell in this IDE installation
  4. call devon command
  5. do echo $KEY (or echo %KEY% in CMD)

Related/Dependent Issues

Comments/Hints:

Affected version:

3.3.1

@hohwille
Copy link
Member Author

Seems to happen only on windows. I can not reproduce in MacOS/Bash.

@hohwille
Copy link
Member Author

I retested the issue in windows with version 3.3.1 in my windows VM.
There I added a new variable foo=bar without newline to the end of ${DEVON_IDE_HOME}/conf/devon.properties.

In CMD the error does not occur and after calling devon the variable is properly set what can be verified with echo %foo% showing bar.
However, when I use git-bash the error does happen on windows and echo $foo does not display bar. If I add the new line at the end of devon.properties it does work.
On MacOS I tested the same both with bash and zsh and the error does not happen.

So the error only happens on in MSYS only due to some incompatibility of bash/gnu/POSIX emulation.

@hohwille
Copy link
Member Author

I am quite clueless how to fix the bug while parsing the file. However, I could add a fix by checking every existing devon.properties if it ends with newline and otherwise just add the missing newline automatically before parsing the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working windows specific for Microsoft Windows OS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant