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

Fix string comparison to use [[ ]] since bashisms are in use anyway. #1

Closed
wants to merge 1 commit into from

Conversation

rpavlik
Copy link
Contributor

@rpavlik rpavlik commented Aug 11, 2017

The == for string equality checking, I believe, is bash syntax - in any case, with the normal sh single-[] syntax, I got:

$ ./xpacks-paths.sh
MINGW64_NT-10.0 not supported

on "git bash" when there's clearly a case intended to handle it. Switching to the bash [[ ]] syntax seemed to fix at least that part.

@ilg-ul
Copy link
Contributor

ilg-ul commented Aug 11, 2017

can you better explain this patch? as far as I know, the [[ ... ]] syntax uses pattern matching.

the xpacks-paths.sh script is not intended to be executed directly, but included with source in the generate.sh script, which uses bash.

@rpavlik
Copy link
Contributor Author

rpavlik commented Aug 11, 2017

Ah, good call - I thought that the [[ ]] syntax was required to get "bash-specific" test builtin behavior, but it seems like you're right: https://unix.stackexchange.com/questions/248164/bash-if-syntax-confusion

In any case, you do use the double brackets elsewhere, and switching to double brackets solved the problem - perhaps switching to a single = would have also done so.

You caught me - my quotation wasn't precise, I had sourced it, lacking any apparent "generate" script... (Trying to get started using this stuff since GNU-MCU-Eclipse works so slick, but having some difficulty.)

@rpavlik
Copy link
Contributor Author

rpavlik commented Aug 11, 2017

Ah ha - so when I used a generate script from the sample eclipse projects, it did the same thing, but this time I tried echoing the substring - turns out it was off by one. I'll open a new PR fixing the real problem.

@rpavlik rpavlik closed this Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants