source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/echoToFile.js@ 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: 591 bytes
Line 
1// echoToFile.js - Write in a given file all the parameters passed on the CLI
2var fs = require('fs'),
3 system = require('system');
4
5if (system.args.length < 3) {
6 console.log("Usage: echoToFile.js DESTINATION_FILE <arguments to echo...>");
7 phantom.exit(1);
8} else {
9 var content = '',
10 f = null,
11 i;
12 for ( i= 2; i < system.args.length; ++i ) {
13 content += system.args[i] + (i === system.args.length-1 ? '' : ' ');
14 }
15
16 try {
17 fs.write(system.args[1], content, 'w');
18 } catch(e) {
19 console.log(e);
20 }
21
22 phantom.exit();
23}
Note: See TracBrowser for help on using the repository browser.