diff --git a/README.rst b/README.rst index f3cda98..527219e 100644 --- a/README.rst +++ b/README.rst @@ -148,8 +148,8 @@ declare them in the shell. The default location of the file is ``~/.squonk2/environments``. If you have multiple installations this allows you to keep all your environment settings together in one file. -You can use an alternative file by setting ``SQUONK2_ENVIRONMENT_FILE``, -e.g. ``export SQUONK2_ENVIRONMENT_FILE=~/my-env'`` +You can use an alternative file by setting ``SQUONK2_ENVIRONMENTS_FILE``, +e.g. ``export SQUONK2_ENVIRONMENTS_FILE=~/my-env'`` .. code-block:: yaml @@ -160,7 +160,7 @@ e.g. ``export SQUONK2_ENVIRONMENT_FILE=~/my-env'`` # It provides all the connection details for one or more Squonk2 environments. # It is expected to be found in the user's home directory # as '~/.squonk2/environments' or the user can 'point' to it by setting - # 'SQUONK2_ENVIRONMENT_FILE', e.g. 'export SQUONK2_ENVIRONMENT_FILE=~/my-env' + # 'SQUONK2_ENVIRONMENTS_FILE', e.g. 'export SQUONK2_ENVIRONMENTS_FILE=~/my-env' # The 'environments' block defines one or more environments. # Each has a name. Here we define an environment called 'site-a' diff --git a/src/squonk2/environment.py b/src/squonk2/environment.py index 4107b86..6d8e6b6 100644 --- a/src/squonk2/environment.py +++ b/src/squonk2/environment.py @@ -24,7 +24,7 @@ # # See the project's 'environments' file for an example of the content of the file. _ENVIRONMENT_DIRECTORY: str = "~/.squonk2" -_ENVIRONMENT_FILE: str = os.environ.get( +_ENVIRONMENTS_FILE: str = os.environ.get( "SQUONK2_ENVIRONMENTS_FILE", f"{_ENVIRONMENT_DIRECTORY}/environments" ) @@ -50,7 +50,9 @@ class Environment: """Loads the values from the environment file for the given environment.""" # Location of the file - __environments_file: str = os.path.expandvars(os.path.expanduser(_ENVIRONMENT_FILE)) + __environments_file: str = os.path.expandvars( + os.path.expanduser(_ENVIRONMENTS_FILE) + ) # Dictionary-form of the entire file __environments_config: Dict[str, Any] = {} # List of names in the configuration