Skip to content

Commit 97da462

Browse files
committed
Rakefile sort methods by execution order. Bring back yarn-run-in
1 parent 2d53816 commit 97da462

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Rakefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,22 @@ def copy_react_asset(webpack_file, destination_file)
1212
FileUtils.cp(full_webpack_path, full_destination_path)
1313
end
1414

15+
# Move to `dirname` and execute `yarn {cmd}`
16+
def yarn_run_in(dirname, cmd)
17+
Dir.chdir(dirname) do
18+
`yarn #{cmd}`
19+
end
20+
end
21+
1522
namespace :react do
1623
desc 'Run the JS build process to put files in the gem source'
1724
task update: [:install, :build, :copy]
1825

26+
desc 'Install the JavaScript dependencies'
27+
task :install do
28+
yarn_run_in('react-builds', 'upgrade')
29+
end
30+
1931
desc 'Build the JS bundles with Webpack'
2032
task :build do
2133
yarn_run_in('react-builds', 'build')
@@ -29,11 +41,6 @@ namespace :react do
2941
copy_react_asset("#{environment}/react-server.js", "#{environment}/react-server.js")
3042
end
3143
end
32-
33-
desc 'Install the JavaScript dependencies'
34-
task :install do
35-
yarn_run_in('react-builds', 'upgrade')
36-
end
3744
end
3845

3946
namespace :ujs do

0 commit comments

Comments
 (0)