aboutsummaryrefslogtreecommitdiffhomepage
path: root/cli/actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/actions.js')
-rw-r--r--cli/actions.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/actions.js b/cli/actions.js
index 954ca6b..25643da 100644
--- a/cli/actions.js
+++ b/cli/actions.js
@@ -31,17 +31,20 @@ function checkConfig() {
31 console.error('Using server %s', config.server().yellow); 31 console.error('Using server %s', config.server().yellow);
32} 32}
33 33
34function collectFiles(filesOrFolders) { 34function collectFiles(filesOrFolders, options) {
35 var tmp = []; 35 var tmp = [];
36 36
37 filesOrFolders.forEach(function (filePath) { 37 filesOrFolders.forEach(function (filePath) {
38 var baseName = path.basename(filePath);
39 if (!options.all && baseName[0] === '.' && baseName.length > 1) return;
40
38 var stat = fs.statSync(filePath); 41 var stat = fs.statSync(filePath);
39 42
40 if (stat.isFile()) { 43 if (stat.isFile()) {
41 tmp.push(filePath); 44 tmp.push(filePath);
42 } else if (stat.isDirectory()) { 45 } else if (stat.isDirectory()) {
43 var files = fs.readdirSync(filePath).map(function (file) { return path.join(filePath, file); }); 46 var files = fs.readdirSync(filePath).map(function (file) { return path.join(filePath, file); });
44 tmp = tmp.concat(collectFiles(files)); 47 tmp = tmp.concat(collectFiles(files, options));
45 } else { 48 } else {
46 console.log('Skipping %s', filePath.cyan); 49 console.log('Skipping %s', filePath.cyan);
47 } 50 }
@@ -90,7 +93,7 @@ function login(uri) {
90function put(filePath, otherFilePaths, options) { 93function put(filePath, otherFilePaths, options) {
91 checkConfig(); 94 checkConfig();
92 95
93 var files = collectFiles([ filePath ].concat(otherFilePaths)); 96 var files = collectFiles([ filePath ].concat(otherFilePaths), options);
94 97
95 async.eachSeries(files, function (file, callback) { 98 async.eachSeries(files, function (file, callback) {
96 var relativeFilePath; 99 var relativeFilePath;