Skip to content

Commit

Permalink
increased logging. Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
technolion committed Jun 21, 2019
1 parent 765cbdd commit 0ef11f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ $ sudo npm update -g skalio/teambeamjs
```

## Release History
* v0.2.4 2019-06-20 Lifting versions of dependencies.
* v0.2.4 2019-06-20 Fixing issue with zipping folders preio to uploading. Lifting versions of dependencies.
* v0.2.3 2018-12-21 Fixing issue where uploads without content-length were rejected.
* v0.2.2 2018-07-24 Fixing issue where files without name extension could not be uploaded. Fixed download of already downloaded transfers.
* v0.2.1 2017-10-26 Fixing issue with number as transfer passphrase. Better temp folder support
* v0.2.0 2017-10-26 Fixing spcial characters issue. Proxy Support. Support for uploading directories. Quiet output flag. Support for IDN domains in E-Mail addresses.
* v0.2.0 2017-10-26 Fixing special characters issue. Proxy Support. Support for uploading directories. Quiet output flag. Support for IDN domains in E-Mail addresses.
* v0.1.3 2016-03-23 Fixing download; adding progress information when `--verbose`
* v0.1.2 2016-03-08 Adds support for download-intervals
* v0.1.1 2016-02-23 Adds support for transfer passwords
Expand Down
22 changes: 15 additions & 7 deletions lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,25 @@ exports.doit = function (options, loggedinUser) {
existFile = true;
var stat = fs.statSync(filename);
if (stat.isDirectory()) {

logHelper.consoleOutput("Adding folder: " + filename);
if (settings.verbose) {
logHelper.consoleOutput("Adding folder: " + filename);
}
var zipFilename = path.basename(filename)+".zip"; //filename.split(path.sep).pop() + ".zip";
if (fs.existsSync(tmpFolder.name + path.sep + zipFilename)) {
//rename the zip-file if this exists in tmpFolder
zipFilename = path.basename(filename) + "(" + copyDirCounter + ").zip";
copyDirCounter++;
}
var zippedFile = tmpFolder.name + path.sep + zipFilename;
logHelper.consoleOutput("Zipping to: " + zippedFile);
zip.sync.zip(filename).compress().save(zippedFile);
reservation.addFile(zippedFile);
var zippedPath = tmpFolder.name + path.sep + zipFilename;
if (settings.verbose) {
logHelper.consoleOutput("Zipping to: " + zippedPath);
}
zip.sync.zip(filename).compress().save(zippedPath);
reservation.addFile(zippedPath);
} else {
logHelper.consoleOutput("Adding file: " + filename);
if (settings.verbose) {
logHelper.consoleOutput("Adding file: " + filename);
}
reservation.addFile(filename);
}
} else {
Expand Down Expand Up @@ -99,6 +104,9 @@ exports.doit = function (options, loggedinUser) {
var curPath = tmpFolder.name + path.sep + file;
fs.unlinkSync(curPath);
});
if (settings.verbose) {
logHelper.consoleOutput('Removing temporary folder for zip archives: ' + tmpFolder.name );
}
fs.rmdirSync(tmpFolder.name);
}

Expand Down

0 comments on commit 0ef11f9

Please sign in to comment.