File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 77__title__ = "python-dotenv-vault"
88__description__ = "Syncing your .env to the cloud."
99__url__ = "https://github.com/dotenv-org/dotenv-vault-python"
10- __version__ = "0.0.8 "
10+ __version__ = "0.0.9 "
1111__author__ = "dotenv"
1212__author_email__ = "[email protected] " 1313__license__ = "MIT"
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ def load_dotenv(
2626 if dotenv_vault .dotenv_key :
2727 logger .info ('Getting .env from vault.' )
2828 vault_stream = dotenv_vault .parsed_vault ()
29- return load_dotenv_file (stream = vault_stream )
29+ # we're going to override the .vault to any existing keys in local
30+ return load_dotenv_file (stream = vault_stream , override = True )
3031 else :
3132 logger .info ('Getting .env from local.' )
3233 return load_dotenv_file ()
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def parsed_vault(self) -> bytes:
3333 if self .dotenv_key is None : raise DotEnvVaultError ("NOT_FOUND_DOTENV_KEY: Cannot find ENV['DOTENV_KEY']" )
3434
3535 # .env.vault needs to be present.
36- env_vault_path = find_dotenv (filename = '.env.vault' )
36+ env_vault_path = find_dotenv (filename = '.env.vault' , usecwd = True )
3737 if env_vault_path == '' :
3838 raise DotEnvVaultError ("ENV_VAULT_NOT_FOUND: .env.vault is not present." )
3939
@@ -56,6 +56,9 @@ def parsed_vault(self) -> bytes:
5656 dotenv = DotEnv (dotenv_path = env_vault_path )
5757 ciphertext = dotenv .dict ().get (environment_key )
5858
59+ if not ciphertext :
60+ raise DotEnvVaultError ('Environment Key is not found. Run `npx dotenv-vault build`.' )
61+
5962 decrypted = self ._decrypt (ciphertext = ciphertext , key = key )
6063 return self ._to_text_stream (decrypted )
6164
You can’t perform that action at this time.
0 commit comments