Giter VIP home page Giter VIP logo

Comments (3)

ashutoshsaboo avatar ashutoshsaboo commented on June 4, 2024

How about this plugin can configure for an optional env variable say - GATSBY_STORK_INSTALL_LOCATION (GATSBY_ prefix as per gatsby best practices). If that variable is set then where you are checking for if stork is installed in the plugin there can be an or check to also execute binary at this path and check if it's version or something to assert stork is installed.

Once that is done, when actually invoking stork for index creation - similarly we can use either stork cli command if it's natively installed or else use ./<ENV_VAR_LOCATION> to invoke stork.

How does that sound ? Would that be a trivial fix? For ease and reducing complexity with the plugin, We can simply ask the client to set the env variable to correct binary executable location (along with chmod +x). Since most will anyways only use this for CIs, this should be quite easy for them to set as well. @reese

from gatsby-plugin-stork.

reese avatar reese commented on June 4, 2024

I think the ENV variable sounds reasonable to me, especially for a quick fix for your use case. In the long term, I think it could also be useful to provide a default installation script during CI and then expose a config flag to optionally run it. There's an is-ci npm package that may be useful for that, and since I would assume that most CI uses Ubuntu, we could provide something similar to the build.sh in the docs and then call it with execSync from inside the plugin, which would mean that clients wouldn't even have to worry about installation. That's a longer-term solution though, we can always support those two separately.

from gatsby-plugin-stork.

reese avatar reese commented on June 4, 2024

@ashutoshsaboo I'll work on a more robust solution in the future, but I just published version 0.3.2 which has a GATSBY_STORK_EXECUTABLE_PATH env variable to override the stork executable location. Hopefully that at least unblocks you for now, but let me know if you run into any issues using that!

from gatsby-plugin-stork.

Related Issues (9)

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.