Sha256: 29b8d141fb1f3d07e77a7b3e35558ec1aa777a29c660d4e5956f4149fa5d10ca

Contents?: true

Size: 163 Bytes

Versions: 12

Compression:

Stored size: 163 Bytes

Contents

# encoding: utf-8

require 'tty-command'

cmd = TTY::Command.new

f = 'file'
if cmd.test("[ -f #{f} ]")
  puts "#{f} already exists!"
else
  cmd.run :touch, f
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tty-command-0.8.1 examples/bash.rb
tty-command-0.8.0 examples/bash.rb
tty-command-0.7.0 examples/bash.rb
tty-command-0.6.0 examples/bash.rb
tty-command-0.5.0 examples/bash.rb
tty-command-0.4.0 examples/bash.rb
tty-command-0.3.3 examples/bash.rb
tty-command-0.3.2 examples/bash.rb
tty-command-0.3.1 examples/bash.rb
tty-command-0.3.0 examples/bash.rb
tty-command-0.2.0 examples/bash.rb
tty-command-0.1.0 examples/bash.rb