source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-macosx/examples/scandir.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: 462 bytes
Line 
1# List all the files in a Tree of Directories
2system = require 'system'
3
4if system.args.length != 2
5 console.log "Usage: phantomjs scandir.coffee DIRECTORY_TO_SCAN"
6 phantom.exit 1
7scanDirectory = (path) ->
8 fs = require 'fs'
9 if fs.exists(path) and fs.isFile(path)
10 console.log path
11 else if fs.isDirectory(path)
12 fs.list(path).forEach (e) ->
13 scanDirectory path + "/" + e if e != "." and e != ".."
14
15scanDirectory system.args[1]
16phantom.exit()
Note: See TracBrowser for help on using the repository browser.