I'd just change line 23 to say `sh "ssh #{server}:#{folder} 'bash -s' < tempgitdeploysetup.sh"`.