async function uploadData (uploadURL, authToken, filename, opts) { // filename may either be .clinic-doctor.html or the data directory // .clinic-doctor const filePrefix = path.join(filename).replace(/\.html$/, '') const isPrivate = opts && opts.private console.log(`Uploading data for ${filePrefix} and ${filePrefix}.html`) const result = await tarAndUploadPromisified(path.resolve(filePrefix), uploadURL, authToken, { private: isPrivate }) result.url = `${uploadURL}${result.html}` return result }