Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export async function main() {
} else {
await commandLine(Deno.args)
}
Deno.exit(0)
}

await main()
13 changes: 8 additions & 5 deletions cli/src/commands/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ export async function downloadAction(
// Close after all tasks are queued
worker.postMessage({ command: "done" })

worker.addEventListener("message", (event) => {
if (event.data.command === "closed") {
console.log(
"Download complete. To download all data files, use `datalad get` or `git-annex get`.",
)
await new Promise<void>((resolve) => {
worker.onmessage = (event) => {
if (event.data.command === "closed") {
console.log(
"Download complete. To download all data files, use `datalad get` or `git-annex get`.",
)
resolve()
}
}
})
}
8 changes: 8 additions & 0 deletions cli/src/commands/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ export async function uploadAction(

// Close after all tasks are queued
worker.postMessage({ command: "done" })

await new Promise<void>((resolve) => {
worker.onmessage = (event) => {
if (event.data.command === "closed") {
resolve()
}
}
})
}

/**
Expand Down