@hubspot/cms-lib
Advanced tools
Comparing version 2.2.1-beta.1 to 2.2.1-beta.3
@@ -107,23 +107,3 @@ const fs = require('fs-extra'); | ||
const logFsError = err => { | ||
logFileSystemErrorInstance( | ||
err, | ||
new FileSystemErrorContext({ | ||
destPath, | ||
accountId, | ||
write: true, | ||
}) | ||
); | ||
}; | ||
let writeStream; | ||
try { | ||
await fs.ensureFile(destPath); | ||
writeStream = fs.createWriteStream(destPath, { encoding: 'binary' }); | ||
} catch (err) { | ||
logFsError(err); | ||
throw err; | ||
} | ||
try { | ||
await http.getOctetStream( | ||
@@ -135,3 +115,3 @@ accountId, | ||
}, | ||
writeStream | ||
destPath | ||
); | ||
@@ -179,2 +159,14 @@ logger.log(`Wrote file "${destPath}"`); | ||
async function fetchFolderContents(accountId, folder, dest, options) { | ||
try { | ||
await fs.ensureDir(dest); | ||
} catch (err) { | ||
logFileSystemErrorInstance( | ||
err, | ||
new FileSystemErrorContext({ | ||
dest, | ||
accountId, | ||
write: true, | ||
}) | ||
); | ||
} | ||
const files = await fetchAllPagedFiles(accountId, folder.id, options); | ||
@@ -181,0 +173,0 @@ for (const file of files) { |
{ | ||
"name": "@hubspot/cms-lib", | ||
"version": "2.2.1-beta.1", | ||
"version": "2.2.1-beta.3", | ||
"description": "Library for working with the HubSpot CMS", | ||
@@ -34,3 +34,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "0f4c21147ac4017d10423123b5cf2c70dfa1c599" | ||
"gitHead": "8958c173115e232ab36ed4661c3da8e080071a21" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291059
9340