Skip to content

Commit a577fc5

Browse files
committed
Use assets config path relative to app root
1 parent 627430a commit a577fc5

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

lib/hanami/cli/commands/app/assets/command.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def fork_child_assets_command(slice)
9494
# @since 2.1.0
9595
# @api private
9696
def assets_command(slice)
97-
cmd = [config.node_command, assets_config(slice).to_s, "--"]
97+
assets_config = assets_config(slice).relative_path_from(slice.app.root).to_s
98+
cmd = [config.node_command, assets_config, "--"]
9899

99100
if slice.eql?(slice.app)
100101
cmd << "--path=app"

spec/unit/hanami/cli/commands/app/assets/watch_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def before_prepare
4949
it "watches the app assets" do
5050
expect(interactive_system_call).to receive(:call).with(
5151
"node",
52-
Hanami.app.root.join("config", "assets.js").to_s,
52+
"config/assets.js",
5353
"--",
5454
"--path=app",
5555
"--dest=public/assets",
@@ -81,7 +81,7 @@ def before_prepare
8181
it "watches the slice assets" do
8282
expect(interactive_system_call).to receive(:call).with(
8383
"node",
84-
Hanami.app.root.join("config", "assets.js").to_s,
84+
"config/assets.js",
8585
"--",
8686
"--path=slices/admin",
8787
"--dest=public/assets/_admin",
@@ -102,7 +102,7 @@ def before_prepare
102102
it "watches the slice assets using the slice's assets config" do
103103
expect(interactive_system_call).to receive(:call).with(
104104
"node",
105-
Hanami.app.root.join("slices", "admin", "config", "assets.js").to_s,
105+
"slices/admin/config/assets.js",
106106
"--",
107107
"--path=slices/admin",
108108
"--dest=public/assets/_admin",
@@ -136,7 +136,7 @@ def before_prepare
136136
it "watches the assets for each slice" do
137137
expect(interactive_system_call).to receive(:call).with(
138138
"node",
139-
Hanami.app.root.join("config", "assets.js").to_s,
139+
"config/assets.js",
140140
"--",
141141
"--path=slices/admin",
142142
"--dest=public/assets/_admin",
@@ -146,7 +146,7 @@ def before_prepare
146146

147147
expect(interactive_system_call).to receive(:call).with(
148148
"node",
149-
Hanami.app.root.join("config", "assets.js").to_s,
149+
"config/assets.js",
150150
"--",
151151
"--path=slices/main",
152152
"--dest=public/assets/_main",

0 commit comments

Comments
 (0)