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

Suggestion: Change line separator when parsing cube makefile #186

Open
olavfla opened this issue May 8, 2024 · 1 comment
Open

Suggestion: Change line separator when parsing cube makefile #186

olavfla opened this issue May 8, 2024 · 1 comment

Comments

@olavfla
Copy link

olavfla commented May 8, 2024

Currently, it seems to convert multiline variables in the makefile to one line in src/getInfo/getCubeMakefileInfo.ts#L65, and separates the variables with spaces. However in some instances it could be useful to include spaces in the makefile, such as in my example: -DGIT_HASH=\"$(shell git rev-parse --short HEAD)\" \ to be able to output which commit is currently flashed. If i put this in the cube Makefile, it ends up like this in STM32Make.make:

-DGIT_BRANCH=\"$(shell \
-DHEAD)\" \
-Dgit \
-Drev-parse

I know this could just be defined in the yaml file instead, but i thought it would be nice to have something more universally compatible. I think this could be fixed by using a more unique separator than a space when parsing into a single line, or avoid parsing to a single line in the first place.

@jortbmd
Copy link
Member

jortbmd commented May 10, 2024

Hi!
Thanks for opening up an issue. Yes the parsing is pretty naive and I did not account for this side effect. To tackle the parser should be build out a bit more. I will think about this as I do feel that these kind of use cases need to be supported. Will let you know when there is a fix. It might take some time as I do not have a lot of time to spend on the extension currently. If you want to fix it yourself you are more than welcome to create a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants