In my .env I have the following variable:
SHOPIFY_STORE_URL=mystore.myshopify.com
Now I want to use this variable in a npm script:
"scripts": {
"shopify-login": "shopify login --store=SHOPIFY_STORE_URL",
},
so $ npm run shopify-login should execute $ shopify login --store=mystore.myshopify.com
How can I achieve this?
When you are on a linux/mac operating system - this should work:
# .env
SHOPIFY_STORE_URL=mystore.myshopify.com
my test case:
"scripts": {
"shopify-login": "source .env && echo $SHOPIFY_STORE_URL"
}
your test case:
"scripts": {
"shopify-login": "source .env && shopify login --store=$SHOPIFY_STORE_URL",
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With