Skip to content
Snippets Groups Projects
Commit 4ac6fc38 authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Add .env file so that debugger follows mcli environment

parent 83aaede4
No related branches found
No related tags found
1 merge request!1Main
......@@ -53,6 +53,8 @@ count-all [-f|--force]
If -f or --force is given, refresh indexes before counting (equivalent to count-streams and index-extensions)
setup
Initialize Python environment required by extractors
setup-debug
(Re)create .env file used by the Python debugger launch config
extract-rdf
Run the extractor to generate RDF from text sources
extract-mp3 [-y|--yes-overwrite]
......@@ -238,6 +240,14 @@ count-all)
setup)
"$SCRIPTS_DIR/setup.sh"
;;
setup-debug)
envfile="$SCRIPTS_DIR/.env"
echo "VERSION='$VERSION'" > "$envfile"
echo "MACAO_ROOT='$MACAO_ROOT'" >> "$envfile"
echo "SOURCES_DIR='$SOURCES_DIR'" >> "$envfile"
echo "SCRIPTS_DIR='$SCRIPTS_DIR'" >> "$envfile"
echo "RESULTS_DIR='$RESULTS_DIR'" >> "$envfile"
;;
convert)
activate_venv
python "$SCRIPTS_DIR/src/main.py"
......
# Python cache and runtime env
__pycache__/
venv/
.env
......@@ -9,28 +9,32 @@
"type": "debugpy",
"request": "launch",
"program": "src/extract.py",
"console": "integratedTerminal"
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env"
},
{
"name": "Python: transform",
"type": "debugpy",
"request": "launch",
"program": "src/transform.py",
"console": "integratedTerminal"
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env"
},
{
"name": "Python: export",
"type": "debugpy",
"request": "launch",
"program": "src/export.py",
"console": "integratedTerminal"
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env"
},
{
"name": "Python: main",
"type": "debugpy",
"request": "launch",
"program": "src/main.py",
"console": "integratedTerminal"
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/.env"
}
]
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment