Merge pull request #5303 from consuldemocracy/fix_fnm_setup

Map node binaries whenever `rvm1:hook` is called and evaluate the `fnm_setup_command` dynamically
This commit is contained in:
Senén Rodero
2023-10-24 15:24:33 +02:00
committed by GitHub

View File

@@ -60,7 +60,7 @@ namespace :deploy do
Rake::Task["delayed_job:default"].clear_actions Rake::Task["delayed_job:default"].clear_actions
Rake::Task["puma:smart_restart"].clear_actions Rake::Task["puma:smart_restart"].clear_actions
after "git:create_release", "map_node_bins" after "rvm1:hook", "map_node_bins"
after :updating, "install_node" after :updating, "install_node"
after :updating, "install_ruby" after :updating, "install_ruby"
@@ -127,7 +127,7 @@ task :map_node_bins do
on roles(:app) do on roles(:app) do
within release_path do within release_path do
with rails_env: fetch(:rails_env) do with rails_env: fetch(:rails_env) do
prefix = "#{fetch(:fnm_setup_command)} && fnm exec" prefix = -> { "#{fetch(:fnm_setup_command)} && fnm exec" }
fetch(:fnm_map_bins).each do |command| fetch(:fnm_map_bins).each do |command|
SSHKit.config.command_map.prefix[command.to_sym].unshift(prefix) SSHKit.config.command_map.prefix[command.to_sym].unshift(prefix)