source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/echoToFile.coffee@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 503 bytes
Line 
1# echoToFile.coffee - Write in a given file all the parameters passed on the CLI
2fs = require 'fs'
3system = require 'system'
4
5if system.args.length < 3
6 console.log "Usage: echoToFile.coffee DESTINATION_FILE <arguments to echo...>"
7 phantom.exit 1
8else
9 content = ""
10 f = null
11 i = 2
12 while i < system.args.length
13 content += system.args[i] + (if i == system.args.length - 1 then "" else " ")
14 ++i
15 try
16 fs.write system.args[1], content, "w"
17 catch e
18 console.log e
19 phantom.exit()
Note: See TracBrowser for help on using the repository browser.