File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export async function main() {
2020 } else {
2121 await commandLine ( Deno . args )
2222 }
23+ Deno . exit ( 0 )
2324}
2425
2526await main ( )
Original file line number Diff line number Diff line change @@ -57,11 +57,14 @@ export async function downloadAction(
5757 // Close after all tasks are queued
5858 worker . postMessage ( { command : "done" } )
5959
60- worker . addEventListener ( "message" , ( event ) => {
61- if ( event . data . command === "closed" ) {
62- console . log (
63- "Download complete. To download all data files, use `datalad get` or `git-annex get`." ,
64- )
60+ await new Promise < void > ( ( resolve ) => {
61+ worker . onmessage = ( event ) => {
62+ if ( event . data . command === "closed" ) {
63+ console . log (
64+ "Download complete. To download all data files, use `datalad get` or `git-annex get`." ,
65+ )
66+ resolve ( )
67+ }
6568 }
6669 } )
6770}
Original file line number Diff line number Diff line change @@ -153,6 +153,14 @@ export async function uploadAction(
153153
154154 // Close after all tasks are queued
155155 worker . postMessage ( { command : "done" } )
156+
157+ await new Promise < void > ( ( resolve ) => {
158+ worker . onmessage = ( event ) => {
159+ if ( event . data . command === "closed" ) {
160+ resolve ( )
161+ }
162+ }
163+ } )
156164}
157165
158166/**
You can’t perform that action at this time.
0 commit comments