Skip to content

Commit

Permalink
added the total number of files to fsinfo output as well as file-not-…
Browse files Browse the repository at this point in the history
…found message
  • Loading branch information
AndiDittrich committed Jan 25, 2016
1 parent e607f1d commit bf42203
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.4.0-BETA ###
* Changed: `fsinfo` will return the total number of files as well as a `No Files found` message - feature requested [on GitHub](https://github.com/AndiDittrich/NodeMCU-Tool/issues/3)

### 1.3.2 ###
* Bugfix: `fsinfo` operation will fail in case there are no files on the esp module - thanks to [soldair on GitHub](https://github.com/AndiDittrich/NodeMCU-Tool/pull/1)

Expand Down
18 changes: 12 additions & 6 deletions lib/NodeMCU-Tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ var Tool = {
if (err){
logError('NodeMCU-Tool', err);
}else{
logStatus('NodeMCU', 'Free Disk Space: ' + meta.remaining + ' KB | Total: ' + meta.total + ' KB');
logStatus('NodeMCU', 'Files stored into Flash (SPIFFS)');
logStatus('NodeMCU', 'Free Disk Space: ' + meta.remaining + ' KB | Total: ' + meta.total + ' KB | ' + files.length + ' Files');

// print fileinfo
files.forEach(function(file){
logStatus('', '\t |- ' + file.name + ' (' + file.size + ' Bytes)');
});
// files found ?
if (files.length==0){
logStatus('NodeMCU', 'No Files found - do you have created the file-system ?');
}else{
logStatus('NodeMCU', 'Files stored into Flash (SPIFFS)');

// print fileinfo
files.forEach(function(file){
logStatus('', '\t |- ' + file.name + ' (' + file.size + ' Bytes)');
});
}

// finished!
connector.disconnect();
Expand Down

0 comments on commit bf42203

Please sign in to comment.