lib/capistrano/tasks/faster_webpacker.rake in capistrano-faster-webpacker-1.0.2 vs lib/capistrano/tasks/faster_webpacker.rake in capistrano-faster-webpacker-1.0.3
- old
+ new
@@ -22,18 +22,19 @@
# precompile if this is the first deploy
raise PrecompileRequired unless latest_release
latest_release_path = releases_path.join(latest_release)
- latest_node_modules_path = latest_release_path.join('node_modules')
+ latest_node_modules_path = latest_release_path.join(fetch(:node_modules_path))
execute(:test, '-e', latest_node_modules_path.to_s) rescue raise PrecompileRequired
+ release_node_modules_path = release_path.join(fetch(:node_modules_path))
begin
- execute(:test, '-L', latest_node_modules_path.to_s)
+ execute(:test, '-L', release_node_modules_path.to_s)
rescue
- execute(:cp, '-r', latest_node_modules_path, release_path)
+ execute(:cp, '-r', latest_node_modules_path, release_node_modules_path.parent)
end
# precompile if the previous deploy failed to finish precompiling
execute(:ls, latest_release_path.join('assets_manifest_backup')) rescue raise(PrecompileRequired)
@@ -86,8 +87,9 @@
'app/javascript',
'config/webpack',
'config/webpacker.yml',
'yarn.lock'
])
+ set :node_modules_path, fetch(:node_modules_path, 'node_modules')
set :assets_shared_dependencies, fetch(:assets_shared_dependencies, [])
end
end