我尝试在deploy.rb中执行类似命令的执行:
private void LocationComboBox_GotFocus(object sender, RoutedEventArgs e)
{
ComboBox combo = (System.Windows.Controls.ComboBox)sender;
var edit = (TextBox)combo.Template.FindName("PART_EditableTextBox", combo);
var selectedText = edit.SelectedText;
if (!string.IsNullOrEmpty(selectedText))
{
Cursor = Cursors.Cross;
}
else
{
Cursor = Cursors.Arrow;
}
}
results = execute 'somecommand'
似乎不返回命令的结果。这样做的正确方法是什么?
答案 0 :(得分:3)
您想使用capture
命令。
result = capture(:echo, "hello world")
result # => "hello world"
Capistrano文档的主页上还显示了一个示例:http://capistranorb.com
答案 1 :(得分:1)
尝试使用反引号:
results = `somecommand`