Giter Site home page Giter Site logo

Comments (7)

seshrs avatar seshrs commented on May 29, 2024

Good call! I agree with you, I think we should just drop the SIG prefix if it works across shells. I'd welcome a PR if you have the bandwidth to do so 😃

from primer-spec.

noah-weingarden avatar noah-weingarden commented on May 29, 2024

Just made one!

On a similar note, .githooks/pre-commit doesn't work with dash, as set -o pipefail is an illegal option. When I tried switching to bash, the script exited 1 when it reached the line MINOR_VERSION=$(cat $PROJECT_ROOT/VERSION | grep -o "\d\.\d").

from primer-spec.

noah-weingarden avatar noah-weingarden commented on May 29, 2024

It's because dirname /home/noah/primer-spec outputs /home/noah, which doesn't have a VERSION file.

from primer-spec.

seshrs avatar seshrs commented on May 29, 2024

On a similar note, .githooks/pre-commit doesn't work with dash, as set -o pipefail is an illegal option.

I think we can safely remove the pipefail option. Do you see other errors in dash after removing that?

It's because dirname /home/noah/primer-spec outputs /home/noah, which doesn't have a VERSION file.

Hmm… the pre-commit hook is supposed to find its own directory and then find the project root from there.

# The following is necessary to resolve symbolic links
pushd $(dirname $0)
GITHOOKS_DIR=`pwd -P`
popd
PROJECT_ROOT=`dirname $GITHOOKS_DIR`

Could you try adding echo statements to check the value of the variables and working directories? I’m currently suspecting that dirname $0 isn’t working as I expected, but I don’t know for sure…

(I’ve only ever tested the builds and scripts on bash on my Mac 😅 )

from primer-spec.

noah-weingarden avatar noah-weingarden commented on May 29, 2024

Could you try adding echo statements to check the value of the variables and working directories?

Good call! Sorry, I was lazy last night and misinterpreted the error: dirname is working fine. The real issue is that my version of grep doesn't recognize \d, since it's not part of basic regular expressions. Switching to grep -o "[[:digit:]]\.[[:digit:]]" or grep -o "[0-9]\.[0-9]" might make the script more cross-platform.

from primer-spec.

noah-weingarden avatar noah-weingarden commented on May 29, 2024

I think we can safely remove the pipefail option. Do you see other errors in dash after removing that?

Apparently dash doesn't have a pushd command. 🤷

from primer-spec.

seshrs avatar seshrs commented on May 29, 2024

This will be fixed when #195 is merged.

from primer-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.