Skip to content

Commit 5621dff

Browse files
committed
Show a relative path when describing configuration missing
For a mounted Rails engine we need the config to be in the application mount directory e.g. test/dummy/config/webpacker.yml By running this based on pwd we get this in a Rails engine app: ``` ➜ rails-plugin rake app:webpacker:verify_install RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment Configuration test/dummy/config/webpacker.yml file not found. Make sure webpacker:install is run successfully before running dependent tasks ``` Whereas in a normal Rails installation it outputs unchanged: ``` ➜ full-app git:(master) ✗ rake webpacker:verify_install RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment Configuration config/webpacker.yml file not found. Make sure webpacker:install is run successfully before running dependent tasks ```
1 parent 326adc3 commit 5621dff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/tasks/webpacker/verify_install.rake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ namespace :webpacker do
44
desc "Verifies if Webpacker is installed"
55
task verify_install: [:check_node, :check_yarn, :check_binstubs] do
66
unless Webpacker.config.config_path.exist?
7-
$stderr.puts "Configuration config/webpacker.yml file not found. \n"\
7+
path = Webpacker.config.config_path.relative_path_from(Pathname.new(pwd)).to_s
8+
$stderr.puts "Configuration #{path} file not found. \n"\
89
"Make sure webpacker:install is run successfully before " \
910
"running dependent tasks"
1011
exit!

0 commit comments

Comments
 (0)