Sha256: 96e37fd08fa19576a00b195e08d55a9145b680495001cea3de71ff7518a4e728

Contents?: true

Size: 503 Bytes

Versions: 17

Compression:

Stored size: 503 Bytes

Contents

# echoToFile.coffee - Write in a given file all the parameters passed on the CLI
fs = require 'fs'
system = require 'system'

if system.args.length < 3
  console.log "Usage: echoToFile.coffee DESTINATION_FILE <arguments to echo...>"
  phantom.exit 1
else
  content = ""
  f = null
  i = 2
  while i < system.args.length
    content += system.args[i] + (if i == system.args.length - 1 then "" else " ")
    ++i
  try
    fs.write system.args[1], content, "w"
  catch e
    console.log e
  phantom.exit()

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
entangled-0.0.13 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
entangled-0.0.12 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
entangled-0.0.11 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee
entangled-0.0.10 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/echoToFile.coffee