carp-streamer
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -119,3 +119,3 @@ "use strict"; | ||
const dirs = dir === '' ? [] : dir.split(path_1.default.sep); | ||
return _findRemoteFileByPath(dirs, base, rootFolder, client); | ||
return yield _findRemoteFileByPath(dirs, base, rootFolder, client); | ||
}); | ||
@@ -127,3 +127,8 @@ } | ||
const folder = yield findRemoteFolderByPath(folderPath, rootFolder, client); | ||
return folder && client.folders.getItems(folder.id).then(items => lodash_1.default.first(items.entries.filter(isMiniFile).filter(item => item.name.normalize() === filename.normalize()))); | ||
if (!folder) | ||
return folder; | ||
const items = yield client.folders.getItems(folder.id); | ||
return lodash_1.default.first(items.entries | ||
.filter(isMiniFile) | ||
.filter(item => item.name.normalize() === filename.normalize())); | ||
}); | ||
@@ -141,3 +146,3 @@ } | ||
const subFolder = lodash_1.default.first(items.entries.filter(isMiniFolder).filter(item_2 => item_2.name === folderName)); | ||
return findRemoteFolderByPath(folderPath.slice(1), subFolder, client); | ||
return yield findRemoteFolderByPath(folderPath.slice(1), subFolder, client); | ||
}); | ||
@@ -144,0 +149,0 @@ } |
@@ -94,3 +94,4 @@ #!/usr/bin/env node | ||
catch (error) { | ||
debug('%s\n%s', error.message, error.stack); | ||
debug('%s: %s', error.name, error.message); | ||
debug('%s', error.stack); | ||
console.log(`Failed to synchronize '${file.relativePath}'.`); | ||
@@ -112,9 +113,10 @@ throw error; | ||
})).then(() => { | ||
console.log('successful!'); | ||
console.log('Successful!'); | ||
process.exit(0); | ||
}).catch(reason => { | ||
console.log(reason.message); | ||
console.log(`failure!`); | ||
console.log('%s: %s', reason.name, reason.message); | ||
debug('%s', reason.stack); | ||
console.log(`Failure!`); | ||
process.exit(1); | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "carp-streamer", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Carp streamer", | ||
@@ -5,0 +5,0 @@ "bin": "dist/index.js", |
@@ -81,3 +81,3 @@ import BoxSDK from 'box-node-sdk'; | ||
const dirs = dir === '' ? [] : dir.split(path.sep); | ||
return _findRemoteFileByPath(dirs, base, rootFolder, client); | ||
return await _findRemoteFileByPath(dirs, base, rootFolder, client); | ||
} | ||
@@ -87,3 +87,9 @@ | ||
const folder = await findRemoteFolderByPath(folderPath, rootFolder, client); | ||
return folder && client.folders.getItems(folder.id).then(items => _.first(items.entries.filter(isMiniFile).filter(item => item.name.normalize() === filename.normalize()))) | ||
if (!folder) return folder; | ||
const items = await client.folders.getItems(folder.id); | ||
return _.first( | ||
items.entries | ||
.filter(isMiniFile) | ||
.filter(item => item.name.normalize() === filename.normalize()) | ||
); | ||
} | ||
@@ -102,3 +108,3 @@ | ||
const subFolder = _.first(items.entries.filter(isMiniFolder).filter(item_2 => item_2.name === folderName)); | ||
return findRemoteFolderByPath(folderPath.slice(1), subFolder, client); | ||
return await findRemoteFolderByPath(folderPath.slice(1), subFolder, client); | ||
}; | ||
@@ -105,0 +111,0 @@ |
@@ -79,3 +79,4 @@ #!/usr/bin/env node | ||
} catch(error) { | ||
debug('%s\n%s', error.message, error.stack); | ||
debug('%s: %s', error.name, error.message); | ||
debug('%s', error.stack); | ||
console.log(`Failed to synchronize '${file.relativePath}'.`); | ||
@@ -89,8 +90,9 @@ throw error; | ||
}).then(() => { | ||
console.log('successful!'); | ||
console.log('Successful!'); | ||
process.exit(0); | ||
}).catch(reason => { | ||
console.log(reason.message); | ||
console.log(`failure!`); | ||
console.log('%s: %s', reason.name, reason.message); | ||
debug('%s', reason.stack); | ||
console.log(`Failure!`); | ||
process.exit(1); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
49133
788