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