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

tools: generate_vsn: remove bashism and use POSIX /bin/sh #2488

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

kaniini
Copy link
Contributor

@kaniini kaniini commented Oct 10, 2019

This PR addresses #1988

Proposed changes include:

  • removal of dependency on /bin/bash for generating the version number, use POSIX /bin/sh

#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#!/bin/sh
DIR="$( cd "$( dirname "$0" )" && pwd )"
GIT_VSN=`git describe --always --tags 2>/dev/null`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine.

But both versions assume, that we are running from one of directories of the repo.
Would still work differently for both versions if called from repo and from outside of repo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would replace with something like:

#!/bin/sh

# Go to repo root
cd `dirname "$0"`/../

GIT_VSN=`git describe --always --tags 2>/dev/null`
if [ $? -eq 0 ]; then
    echo $GIT_VSN
else
    cat VERSION
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arcusfelis thanks for the tip. I applied it and merge the PR into master.

@michalwski michalwski merged commit 7c203b5 into esl:master Oct 28, 2019
@michalwski
Copy link
Contributor

@kaniini, thanks for you contribution. I merged your PR!

@michalwski michalwski added this to the 3.6.0 milestone Jan 22, 2020
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

Successfully merging this pull request may close these issues.

3 participants