Skip to content

Commit

Permalink
fix: correctly resolve home dir in folders download (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwwoda authored Sep 7, 2022
1 parent 81dc124 commit 86d3230
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/folders/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class FoldersDownloadCommand extends BoxCommand {

if (flags.zip) {
let fileName = `folders-download-${id}-${dateTime.format(new Date(), 'YYYY-MM-DDTHH_mm_ss_SSS')}.zip`;
outputPath = path.resolve(destinationPath, fileName);
outputPath = path.join(destinationPath, fileName);
outputFinalized = this._setupZip(outputPath);
}

Expand All @@ -75,7 +75,7 @@ class FoldersDownloadCommand extends BoxCommand {
if (item.type === 'folder' && !this.zip) {

// Set output path to the top-level folder, which is the first item in the generator
outputPath = outputPath || path.resolve(destinationPath, item.path);
outputPath = outputPath || path.join(destinationPath, item.path);

spinner.text = `Creating folder ${item.id} at ${item.path}`;
try {
Expand Down Expand Up @@ -193,6 +193,7 @@ FoldersDownloadCommand.flags = {
...BoxCommand.flags,
destination: flags.string({
description: 'The destination folder to download the Box folder into',
parse: utils.parsePath
}),
zip: flags.boolean({
description: 'Download the folder into a single .zip archive',
Expand Down

0 comments on commit 86d3230

Please sign in to comment.