@@ -516,6 +516,7 @@ def gen_typespec(
516516 typespec_python = "@azure-tools/typespec-python"
517517 # call scirpt to generate sdk
518518 try :
519+ tsp_client = "npx --prefix eng/common/tsp-client tsp-client"
519520 if spec_folder :
520521 tsp_dir = (Path (spec_folder ) / typespec_relative_path ).resolve ()
521522 repo_url = rest_repo_url .replace ("https://github.com/" , "" )
@@ -527,15 +528,15 @@ def gen_typespec(
527528 content ["options" ]["@azure-tools/typespec-python" ]["api-version" ] = api_version
528529 with open (tspconfig , "w" ) as file_out :
529530 yaml .dump (content , file_out )
530- cmd = f"tsp-client init --tsp-config { tsp_dir } --local-spec-repo { tsp_dir } --commit { head_sha } --repo { repo_url } "
531+ cmd = f"{ tsp_client } init --tsp-config { tsp_dir } --local-spec-repo { tsp_dir } --commit { head_sha } --repo { repo_url } "
531532 else :
532533 tsp_config_url = f"{ rest_repo_url } /blob/{ head_sha } /{ typespec_relative_path } /tspconfig.yaml"
533- cmd = f"tsp-client init -c { tsp_config_url } "
534+ cmd = f"{ tsp_client } init -c { tsp_config_url } "
534535 if run_in_pipeline :
535536 emitter_name = "@azure-tools/typespec-python"
536537 if not os .path .exists (f"node_modules/{ emitter_name } " ):
537538 _LOGGER .info ("install dependencies only for the first run" )
538- check_output ("tsp-client install-dependencies" , stderr = STDOUT , shell = True )
539+ check_output (f" { tsp_client } install-dependencies" , stderr = STDOUT , shell = True )
539540 else :
540541 _LOGGER .info (f"skip install since { emitter_name } is already installed" )
541542 cmd += " --skip-install --debug"
0 commit comments