import * as fs from "fs" ; import { ExecOptions } from "@actions/exec/lib/interfaces" ; import { exec } from "@actions/exec" ; import { spawn } from "child_process" ; const AZ_TIMEOUT_SECONDS = 120 ; param azPath param args param options export async function runAzCliCommand ( azPath , args , options = { } ) { await exec ( azPath , args , options ) ; } param azPath param args param kubeconfigPath returns export async function runAzKubeconfigCommandBlocking ( azPath , args , kubeconfigPath ) { const proc = spawn ( azPath , args , { detached : true , stdio : "ignore" , } ) ; proc . unref ( ) ; await sleep ( AZ_TIMEOUT_SECONDS ) ; return fs . readFileSync ( kubeconfigPath ) . toString ( ) ; } const sleep = ( seconds ) => new Promise ( ( resolve ) => setTimeout ( resolve , seconds * 1000 ) ) ;