0
我在capistrano 3.4中编写一个任务,在部署的代码中打印git版本号。我可以打印代码。这里我想将输出代码存储在某个变量中。我如何在Ruby变量中存储shell命令的输出。以下是我的任务。ruby变量bash shell命令输出分配capistrano
desc "version number"
task :set_current_version do
on roles(:app) do
execute "version=#{current_path}/REVISION ; cat $version "
end
end
我需要在变量中存储cat $ version的输出。所以我可以在另一个代码中引用这个变量。