Skip to content

Commit

Permalink
move jarchive out of priv and out of git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoung786 committed Feb 4, 2024
1 parent a37719a commit bcb048b
Show file tree
Hide file tree
Showing 8,749 changed files with 18 additions and 8,703 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jeopardy-*.tar
npm-debug.log
/assets/node_modules/

/priv/jarchive
/jarchive
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ WantedBy=multi-user.target

```
DATABASE_PATH="/path/to/sqlite/database/file"
JARCHIVE_PATH="/path/to/jarchive"
SECRET_KEY_BASE="result of mix phx.gen.secret"
PHX_HOST="public hostname"
PORT=80
Expand Down
2 changes: 2 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ config :logger, :console,
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason

config :jeopardy, Jeopardy.JArchive, path: Path.expand("jarchive")

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"
11 changes: 11 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ if config_env() == :prod do
],
secret_key_base: secret_key_base

##################################################
# JArchive
jarchive_path =
System.get_env("JARCHIVE_PATH") ||
raise """
environment variable JARCHIVE_PATH is missing.
For example: /etc/jeopardy/jarchive
"""

config :jeopardy, Jeopardy.JArchive, path: jarchive_path

##################################################
# Mailer

Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ config :logger, level: :warning
# Initialize plugs at runtime for faster test compilation
config :phoenix, :plug_init_mode, :runtime

config :jeopardy, jarchive_dir: "test/support/jarchive"
config :jeopardy, Jeopardy.JArchive, path: Path.expand("test/support/jarchive")
4 changes: 2 additions & 2 deletions lib/jeopardy/j_archive.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ defmodule Jeopardy.JArchive do
alias Jeopardy.Repo

def path do
default = Application.app_dir(:jeopardy, "priv/jarchive")
Application.get_env(:jeopardy, :jarchive_dir, default)
config = Application.get_env(:jeopardy, __MODULE__)
Keyword.get(config, :path)
end

def completed_seasons_path, do: Application.app_dir(:jeopardy, "priv/jarchive/completed_seasons")
Expand Down
1 change: 0 additions & 1 deletion priv/jarchive/1.json

This file was deleted.

Loading

0 comments on commit bcb048b

Please sign in to comment.