Permalink
Browse files

Added script to list contents of dropfolder folder

  • Loading branch information...
davidmerfield committed Nov 19, 2018
1 parent 4cbafda commit c4fea11197b8e843408b4402e7fc08a217af6f8d
Showing with 32 additions and 0 deletions.
  1. +32 −0 scripts/dropbox/list_contents.js
@@ -0,0 +1,32 @@
var DropboxDatabase = require("../../app/clients/dropbox/database");
var createClient = require("../../app/clients/dropbox/util/createClient");
var get = require("../blog/get");
get(process.argv[2], function(user, blog) {
var path = process.argv[3] || "";
console.log(
"Warning, this uses internal functions of Dropbox client. Listing contents of " +
path +
"...",
blog.handle
);
DropboxDatabase.get(blog.id, function(err, account) {
if (err) throw err;
var client = createClient(account.access_token);
client
.filesListFolder({
path: path
})
.catch(function(err) {
console.log(err);
})
.then(function(res) {
console.log(res);
process.exit();
});
});
});

0 comments on commit c4fea11

Please sign in to comment.