Comments (6)
Yeah, .env format is a very hard to completely master, especially since it even differs between PHP and JS slightly. I will remove the magic, it will get really bloated otherwise.
from envault.
Hey, I just released v1.3.3 that disables quote removal when importing variables.
from envault.
Hi, thanks for highlighting this issue.
It's actually intentional behaviour that double quotes get removed when you import. They should then added back when you sync with the NPX command. This abstraction ensures formatting consistency, as some people may forget to use them when they should, and some may use them when they shouldn't.
I admit that I had not thought of doing this with single quotes as well, and it should also happen when you add a variable on its own. I will work on getting this sorted.
Apart from values that contain a
, can you think of anything else in the value that needs escaping in this way?
from envault.
@danharrin thanks for confirmation. I will continues using it and see how it goes. Dw too much about it. If I find a situation where it is causing a problem I'll let you know.
Single quotes theoretically could be part of the string within FOO="'BAR'"
a .env so if import something like FOO='BAR'
would it then sync as FOO="'BAR'"
or remove it? It is very unlikely/rare case but what about handling "" within '' ? Ex: FOO='"BAR"'
. Not sure if anyone would have some kind of long text in description that contains multiple types of quotes or a bearer token with ' or " :) What would happen if I import FOO="BAR"
it adds as FOO=BAR
, I edit the value quote it myself and it becomes FOO="BAR"
and then run a command which makes it FOO="BAR"
then it technically should be FOO='"BAR"'
or FOO="\"BAR\""
(maybe I want the quotes for whatever reason).
Even though I appreciate the magic that sanitizes the variables on npx command, I am not certain it would handle every rule of dot env. Last time I checked the variables that get unquoted and not needed to be quoted are left unquoted so it basically removes the manual quotes I had it .env (I tend to quote strings regardless) but it did leave quotes where it needs it.
from envault.
I do see what you're saying. Should we remove the magic and have quotes manually applied? I just feel that there are so many edge cases that we would probably never get it completely perfect.
from envault.
I do see what you're saying. Should we remove the magic and have quotes manually applied? I just feel that there are so many edge cases that we would probably never get it completely perfect.
Yea, I understand. I could say you could have magic sanitize as an option but with a choice not to use it (in .env) but whether or not that makes code more bloated or not and whether it is worth it. Or like you said let user handle it. There is a date format I use that in php dot env in laravel failed when it IS double quote but doesn't when it is single or unquoted: FORMAT="Ymd\THis"
this fails in date, gmdate or/and Carbon but doesnt if it is FORMAT='Ymd\THis'
or FORMAT=Ymd\THis
. It is like a situation where I just want T to be T and not timezone abbreviation. Ex: 20200510T1000000
from envault.
Related Issues (20)
- Slacknotification using singular instead of plural HOT 1
- Unresponsive UI HOT 5
- Missing the pencil icon HOT 3
- Trusted proxies prevents running envault behind cloudflare HOT 3
- NPX Envault Setup Error through Valet HOT 1
- Variables Fail To Import HOT 1
- Unable to login after creating a user and logging out HOT 3
- No .env found with env HOT 1
- "npx envault" command incorrectly reports changes HOT 2
- Incorrect Field Definition in Failed Job Table HOT 1
- Unable to login HOT 1
- Error: Looks like your setup token is invalid, please get another! HOT 2
- no found livewire.js HOT 1
- No change detected, I have many change HOT 1
- Missing assets with laravel vapor HOT 3
- All requests are done using HTTPS HOT 5
- In portal to sign in view error 500 HOT 2
- envault.dev seems down. HOT 1
- Unclear docs, missing env variables and more... HOT 2
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 envault.