Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port setup bash scripts to Crystal #875

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion fixtures/src_template/expected/Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
system_check: script/system_check && sleep 100000
system_check: crystal script/system_check.cr
web: lucky watch
67 changes: 0 additions & 67 deletions fixtures/src_template/expected/script/helpers/function_helpers

This file was deleted.

Empty file.
32 changes: 0 additions & 32 deletions fixtures/src_template/expected/script/helpers/text_helpers

This file was deleted.

38 changes: 0 additions & 38 deletions fixtures/src_template/expected/script/setup

This file was deleted.

28 changes: 28 additions & 0 deletions fixtures/src_template/expected/script/setup.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require "./helpers/*"

notice "Running System Check"

require "./system_check"

print_done


notice "Installing shards"
run_command "shards", "install"

if !File.exists?(".env")
notice "No .env found. Creating one."
File.touch ".env"
print_done
end

notice "Setting up the database"

run_command "lucky", "db.setup"

notice "Seeding the database with required and sample records"
run_command "lucky", "db.seed.required_data"
run_command "lucky", "db.seed.sample_data"

print_done
notice "Run 'lucky dev' to start the app"
34 changes: 0 additions & 34 deletions fixtures/src_template/expected/script/system_check

This file was deleted.

18 changes: 18 additions & 0 deletions fixtures/src_template/expected/script/system_check.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require "./helpers/*"

# Use this script to check the system for required tools and process that your app needs.
# A few helper functions are provided to keep the code simple. See the
# script/helpers/function_helpers.cr file for more examples.
#
# A few examples you might use here:
# * 'lucky db.verify_connection' to test postgres can be connected
# * Checking that elasticsearch, redis, or postgres is installed and/or booted
# * Note: Booting additional processes for things like mail, background jobs, etc...
# should go in your Procfile.dev.


## CUSTOM PRE-BOOT CHECKS ##
# example:
# if command_not_running "redis-cli", "ping"
# print_error "Redis is not running."
# end
2 changes: 1 addition & 1 deletion fixtures/src_template__api_only/expected/Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
system_check: script/system_check && sleep 100000
system_check: crystal script/system_check.cr
web: lucky watch

This file was deleted.

This file was deleted.

38 changes: 0 additions & 38 deletions fixtures/src_template__api_only/expected/script/setup

This file was deleted.

28 changes: 28 additions & 0 deletions fixtures/src_template__api_only/expected/script/setup.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require "./helpers/*"

notice "Running System Check"

require "./system_check"

print_done


notice "Installing shards"
run_command "shards", "install"

if !File.exists?(".env")
notice "No .env found. Creating one."
File.touch ".env"
print_done
end

notice "Setting up the database"

run_command "lucky", "db.setup"

notice "Seeding the database with required and sample records"
run_command "lucky", "db.seed.required_data"
run_command "lucky", "db.seed.sample_data"

print_done
notice "Run 'lucky dev' to start the app"
Loading
Loading