Skip to content

Commit

Permalink
Update instruction to run the dummy app locally
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jun 5, 2023
1 parent fe287ab commit f430ad6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ to set up the database for testing.
### Run your tests with:

```bash
$ bundle exec rspec
$ bin/rspec
```

**Alternatively** you can just run*:
Expand All @@ -334,7 +334,7 @@ You can even start the dummy app and use it to manually test your changes with:
```bash
$ cd spec/dummy
$ bin/setup
$ bin/rails s
$ bin/dev
```


Expand Down
18 changes: 11 additions & 7 deletions spec/dummy/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)

# path to alchemy gem
GEM_ROOT = File.expand_path("../../..", __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

FileUtils.chdir GEM_ROOT do
puts "\n== Linking Admin JS package =="
system! "yarn link"
end

FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
Expand All @@ -17,17 +25,13 @@ FileUtils.chdir APP_ROOT do
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
puts "\n== Installing Node dependencies =="
system! "yarn link @alchemy_cms/admin"
system! "yarn install"

puts "\n== Preparing database =="
system! "bin/rails db:prepare"

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! "bin/rails restart"
end

0 comments on commit f430ad6

Please sign in to comment.