This is the README for "sync-env" which helps you keep your env files in sync. Once you have installed the sync-env
extension, it will begin synchronizing any source env file and destination env file/files found in your project root folder. It also works with sub folders too.
Annnnd if you like it, consider suppporting me at Pateron
Download and install it from the vs-code market here
The extension assumes that your config files are .env
(source) and .env.example
(destination) by default. Yeah we know that this is not the case all the time. You can specify which file is your source file and which is the destination file/files.
To configure:
- Click on the settings Icon:
- Then click on Settings option. Then select Extensions:
- Then click on SyncEnv Settings:
- Finally, set your files as you wish:
Note that the
Env Destination
can be a string or an array. Example:
".env.local"
OR
[
".env.example",
".env.local",
".env.development"
]
Also, Note that the
Env Source
is just a string. Example of input is:
".env"
The extension is activated automatically by default when it is first installed. In case you have deactivated it before, you can activate it using by:
- Shift + Command + P
- Type into the command pallet -
Activate Watchers
to bring out the command, then click on it.
To deactivate the extension:
- Shift + Command + P
- Type into the command pallet -
Deactivate Watchers
to bring out the command, then click on it to deactivate the extension.
Notable changes:
- Added basics for writing tests
- Provided provision for customising .env files
- Prompt to copy content of watched files for created config file.
- Refactored code
- Added extension activation command
- Added extension deactivation command
- Env variable can now be synced!
- Comments are now respected -
- Refactored code to allow activating and deactivating the extension
- You can now customize/specify your env files
- fix:Sync Issue when value contains
=
[#22]
Please, open an issue on GitHub if you want to report a bug or you thought of a good feature to have.
Contribution is always wellcomed!
-
Allow users to set the files they want to sync.
-
[] ...And other requested features
MIT License
Copyright (c) 2022 Gideon Onwuka
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.