Skip to content

Commit

Permalink
docs: Corrected environment file documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Mar 5, 2024
1 parent 34c58a1 commit 5c4fcae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
6 changes: 4 additions & 2 deletions src/squonk2/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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
Expand Down

0 comments on commit 5c4fcae

Please sign in to comment.