Skip to content
Merged
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
9 changes: 9 additions & 0 deletions src/app.cr
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
parser.banner = "Usage: #{PlaceOS::FrontendLoader::APP_NAME} [arguments]"

# Application flags
parser.on("--www=CONTENT_DIR", "Specifies the content directory") { |d| content_directory = d }

Check notice on line 19 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> parser.on("--www=CONTENT_DIR", "Specifies the content directory") { |d| content_directory = d }
                                                                       ^
parser.on("--update-crontab=CRON", "Specifies the update crontab") { |c| update_crontab = c }

Check notice on line 20 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> parser.on("--update-crontab=CRON", "Specifies the update crontab") { |c| update_crontab = c }
                                                                        ^
parser.on("--git-username=USERNAME", "Specifies the git username") { |u| git_username = u }

Check notice on line 21 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> parser.on("--git-username=USERNAME", "Specifies the git username") { |u| git_username = u }
                                                                        ^
parser.on("--git-password=PASSWORD", "Specifies the git password") { |p| git_password = p }

Check notice on line 22 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> parser.on("--git-password=PASSWORD", "Specifies the git password") { |p| git_password = p }
                                                                        ^

# Server flags
parser.on("-b HOST", "--bind=HOST", "Specifies the server host") { |h| host = h }

Check notice on line 25 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> parser.on("-b HOST", "--bind=HOST", "Specifies the server host") { |h| host = h }
                                                                      ^
parser.on("-p PORT", "--port=PORT", "Specifies the server port") { |p| port = p.to_i }

Check notice on line 26 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> parser.on("-p PORT", "--port=PORT", "Specifies the server port") { |p| port = p.to_i }
                                                                      ^
parser.on("-r", "--routes", "List the application routes") do
ActionController::Server.print_routes
exit 0
Expand Down Expand Up @@ -71,6 +71,15 @@

require "./config"

# Clean up any leftover temp folders from previous runs
www_dir = File.expand_path(PlaceOS::FrontendLoader::WWW)
temp_dirs = Dir.children(www_dir)
.select { |child| File.directory?(Path[www_dir, child]) }
.select(&.matches?(/^.+_temp_\d+$/))
.map { |dir| Path[www_dir, dir] }
temp_dirs.each { |dir| Log.info { "removing stale temp folder: #{Path[dir].basename}" } }
FileUtils.rm_rf(temp_dirs) unless temp_dirs.empty?

# Configure the database connection. First check if PG_DATABASE_URL environment variable
# is set. If not, assume database configuration are set via individual environment variables
if pg_url = ENV["PG_DATABASE_URL"]?
Expand All @@ -82,8 +91,8 @@
# Configure the loader

PlaceOS::FrontendLoader::Loader.configure do |settings|
content_directory.try { |cd| settings.content_directory = cd }

Check notice on line 94 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> content_directory.try { |cd| settings.content_directory = cd }
                           ^
update_crontab.try { |uc| settings.update_crontab = uc }

Check notice on line 95 in src/app.cr

View workflow job for this annotation

GitHub Actions / Ameba

Naming/BlockParameterName

Disallowed block parameter name found
Raw output
> update_crontab.try { |uc| settings.update_crontab = uc }
                        ^
end

# Server Configuration
Expand Down
Loading