Giter VIP home page Giter VIP logo

Comments (7)

toddbluhm avatar toddbluhm commented on May 18, 2024 1

Thanks for the info, this helps a ton. I will try to get around to fixing it, this week and then release this upcoming the weekend.

from env-cmd.

toddbluhm avatar toddbluhm commented on May 18, 2024

Yeah, thanks for bringing this up. I thought I had absolute pathing working, but apparently not. I will look into this.

from env-cmd.

toddbluhm avatar toddbluhm commented on May 18, 2024

Hey so I was just looking into this briefly, and could you give me more specifics about case. I was just checking my test cases because I was sure I had this covered and I do have absolute paths covered, but maybe I am missing an edge case.

What OS are you using? (windows, mac, linux, solaris 😉)
What shell are you using? (bash, powershell, zsh, etc..)
What does the full env-cmd command look like that you are trying to use?
What does the command look like that you are executing on the shell prompt? nuxt start?

Hopefully, the answers to those questions will help me diagnose this further.

from env-cmd.

jonnyparris avatar jonnyparris commented on May 18, 2024

Heya,

Just reconfirmed locally using bash on ubuntu 16.04:

  • node_modules/.bin/env-cmd /etc/testymctest.env yarn start => variables do not load

  • node_modules/.bin/env-cmd testymctest.env yarn start => variables load as expected (such a great utility, thanks for sharing btw)

Setting the server port with PORT=3333 in the env file is great for testing because you get instant feedback when nuxt starts as it prints OPEN http://localhost:3333 when its parsed the variables successfully.

Hope that helps. I've already settled for using a local env file for now but this fix would be handy for future projects.

from env-cmd.

toddbluhm avatar toddbluhm commented on May 18, 2024

@jonnyparris So I was just messing around with a similar setup on my mac and realized that the /etc folder files (at least on mac) usually have more strict permissions than normal files. I was able to get absolute pathing working out of my /etc directory, but I had to make sure the permissions of the env file had the r (read) flag set for all of them (owner, group, others). Could you check your permissions and see if that is the issue?

from env-cmd.

jonnyparris avatar jonnyparris commented on May 18, 2024

sorry dude I'm not on that project anymore but absolute paths do seem to work on mac fwiw

from env-cmd.

toddbluhm avatar toddbluhm commented on May 18, 2024

So I finally found time to boot up my linux vm. Ran everything exactly as was stated node_modules/.bin/env-cmd /etc/testymctest.env yarn start using PORT=3333 in the env file and it all worked great. It printed out 3333 from process.env.PORT.

At this point, I feel like I have spent enough time debugging this. I think the issue comes down to permissions and that the /etc folder files can have weird permissions sometimes. If someone can figure out an easily reproducible way to show this bug exists, I will be happy to revisit it.

@jonnyparris Thanks again for the bug report. I am sorry I was unable to reproduce it. Closing for now, but anyone is welcome to comment if they figure it out.

from env-cmd.

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.