Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

# Used by dotenv library to load environment variables.
.env
.env-*

# Ignore Byebug command history file.
.byebug_history
Expand Down
37 changes: 37 additions & 0 deletions data/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Copyright © 2025-26 l5yth & contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -euo pipefail

# Usage: config.sh [profile | PATH] [args for mesh_env...]
# Default env file: repo-root .env. With profile: .env-<profile> (letters, digits, _, -).
# Or pass a path to any .env file as the first argument (not a bare profile token).

_script_dir="$(cd "$(dirname "$0")" && pwd)"
cd "${_script_dir}"

_repo_root="$(cd "${_script_dir}/.." && pwd)"
# shellcheck source=potato_mesh_env.sh
source "${_script_dir}/potato_mesh_env.sh"

potato_mesh_resolve_env_file config "${_repo_root}" "$@"
shift "${_potato_mesh_env_shift}"

potato_mesh_source_env_if_exists "${_env_file}"

potato_mesh_venv_and_requirements "${_script_dir}/requirements.txt"

export PYTHONPATH="${_script_dir}"
exec python -m mesh_env "${_env_file}" "$@"
21 changes: 17 additions & 4 deletions data/mesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,21 @@

set -euo pipefail

python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r "$(dirname "$0")/requirements.txt"
# Usage: mesh.sh [profile]
# Loads repo-root .env, or .env-<profile> when profile is given (letters, digits, _, -).

_script_dir="$(cd "$(dirname "$0")" && pwd)"
_repo_root="$(cd "${_script_dir}/.." && pwd)"
# shellcheck source=potato_mesh_env.sh
source "${_script_dir}/potato_mesh_env.sh"

potato_mesh_resolve_env_file mesh "${_repo_root}" "$@"
shift "${_potato_mesh_env_shift}"
if [[ $# -gt 0 ]]; then
echo "mesh.sh: unexpected arguments (only optional profile name is supported): $*" >&2
exit 2
fi

potato_mesh_source_env_if_exists "${_env_file}"
potato_mesh_venv_and_requirements "${_script_dir}/requirements.txt"
exec python mesh.py
15 changes: 15 additions & 0 deletions data/mesh_env/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright © 2025-26 l5yth & contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Interactive configuration helpers for the mesh ingestor (standalone from mesh_ingestor)."""
Loading
Loading