Skip to content

Commit

Permalink
Implements generated setup bash scripts in Crystal for better cross p…
Browse files Browse the repository at this point in the history
…latform compatibility. Fixes #872
  • Loading branch information
jwoertink committed Nov 12, 2024
1 parent 6e9f7c7 commit 5c6505c
Show file tree
Hide file tree
Showing 42 changed files with 308 additions and 905 deletions.
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.

Empty file.

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

0 comments on commit 5c6505c

Please sign in to comment.