self.kill

in lib/taste_tester/tunnel.rb [69:94]


    def self.kill(name)
      ssh = TasteTester::SSH.new(name)
      
      
      
      
      if TasteTester::Config.windows_target
        cmd = <<~EOPS
          if (Test-Path "#{TasteTester::Config.timestamp_file}") {
            $x = cat "#{TasteTester::Config.timestamp_file}"
            if ($x -ne $null) {
              kill -Force $x 2>$null
            }
          }
          $LASTEXITCODE = 0
        EOPS
      else
        cmd = "( [ -s #{TasteTester::Config.timestamp_file} ]" +
              ' && kill -9 -- ' +
              "-\$(cat #{TasteTester::Config.timestamp_file}) 2>/dev/null; " +
              ' true )'
      end
      ssh << cmd
      ssh.run!
    end