Commit c130f0629d30ed83efb812e5c37be6cd8e829e66
1 parent
3259d858
Exists in
wikilibras
Add wikilibras python script path to .env and initializer
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
config/examples/.env.example
| @@ -3,5 +3,4 @@ DOMAIN_NAME: # for api callback | @@ -3,5 +3,4 @@ DOMAIN_NAME: # for api callback | ||
| 3 | 3 | ||
| 4 | VLIBRAS_API: | 4 | VLIBRAS_API: |
| 5 | 5 | ||
| 6 | -# gmail password | ||
| 7 | -# api address... | ||
| 8 | \ No newline at end of file | 6 | \ No newline at end of file |
| 7 | +WIKILIBRAS_PYTHON_SCRIPT_PATH: | ||
| 9 | \ No newline at end of file | 8 | \ No newline at end of file |
config/initializers/check_env_vars.rb
| @@ -5,3 +5,10 @@ end | @@ -5,3 +5,10 @@ end | ||
| 5 | if ENV['VLIBRAS_API_URL'].nil? || ENV['VLIBRAS_API_URL'].empty? | 5 | if ENV['VLIBRAS_API_URL'].nil? || ENV['VLIBRAS_API_URL'].empty? |
| 6 | raise 'VLIBRAS_API_URL must be set in .env' | 6 | raise 'VLIBRAS_API_URL must be set in .env' |
| 7 | end | 7 | end |
| 8 | + | ||
| 9 | +if ENV['WIKILIBRAS_PYTHON_SCRIPT_PATH'].nil? || ENV['WIKILIBRAS_PYTHON_SCRIPT_PATH'].empty? | ||
| 10 | + raise 'WIKILIBRAS_PYTHON_SCRIPT_PATH must be set in .env' | ||
| 11 | +end | ||
| 12 | + | ||
| 13 | +`test -e #{ENV['WIKILIBRAS_PYTHON_SCRIPT_PATH']}` | ||
| 14 | +raise SystemCallError, "WIKILIBRAS_PYTHON_SCRIPT_PATH not found" unless $?.success? |