@@ -22,7 +22,7 @@ export async function fetchMetadata(identifier: string): Promise<any> {
2222}
2323
2424export async function fetchTasks ( identifier : string ) : Promise < any > {
25- const result = await execFile ( IA_COMMAND , [ ' tasks' , identifier ] , {
25+ const result = await execFile ( IA_COMMAND , [ " tasks" , identifier ] , {
2626 env : getVenvEnv ( ) ,
2727 } ) ;
2828 return result . stdout
@@ -35,7 +35,7 @@ export async function uploadFile(
3535 identifier : string ,
3636 filepath : string
3737) : Promise < any > {
38- await execFile ( IA_COMMAND , [ ' upload' , identifier , filepath ] , {
38+ await execFile ( IA_COMMAND , [ " upload" , identifier , filepath ] , {
3939 env : getVenvEnv ( ) ,
4040 } ) ;
4141}
@@ -45,19 +45,19 @@ export async function uploadFiles(
4545 filepaths : string [ ] ,
4646 metadata ?: { [ key : string ] : string }
4747) : Promise < any > {
48- const args = [ ' upload' , identifier , ...filepaths ] ;
49-
48+ const args = [ " upload" , identifier , ...filepaths ] ;
49+
5050 if ( metadata ) {
5151 Object . entries ( metadata ) . forEach ( ( [ key , value ] ) => {
5252 args . push ( `--metadata=${ key } :${ value } ` ) ;
5353 } ) ;
5454 }
55-
55+
5656 await execFile ( IA_COMMAND , args , { env : getVenvEnv ( ) } ) ;
5757}
5858
5959export async function identifierExists ( identifier : string ) : Promise < boolean > {
60- const result = await execFile ( IA_COMMAND , [ ' metadata' , identifier ] , {
60+ const result = await execFile ( IA_COMMAND , [ " metadata" , identifier ] , {
6161 env : getVenvEnv ( ) ,
6262 } ) ;
6363 const data = JSON . parse ( result . stdout ) ;
@@ -69,6 +69,10 @@ export async function setMetadata(
6969 data : { [ key : string ] : string }
7070) {
7171 const pairs = Object . entries ( data ) . map ( ( [ key , value ] ) => `${ key } :${ value } ` ) ;
72- const args = [ 'metadata' , identifier , ...pairs . map ( ( pair ) => `--modify=${ pair } ` ) ] ;
72+ const args = [
73+ "metadata" ,
74+ identifier ,
75+ ...pairs . map ( ( pair ) => `--modify=${ pair } ` ) ,
76+ ] ;
7377 await execFile ( IA_COMMAND , args , { env : getVenvEnv ( ) } ) ;
7478}
0 commit comments