Comments (3)
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.
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.
@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)
- implement `yarn start` HOT 4
- Bug: Undefined errors while attempting to create new index HOT 16
- Feature Request: Add support for pathPrefix in the plugin
- Support all index configuration options
- Support all JS configuration options on the input component.
- Add option to delay `stork.register` until user interaction.
- Support generating multiple search indexes.
- Create a Gatsby starter using this plugin.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-stork.