@@ -516,6 +516,7 @@ def gen_typespec(
516
516
typespec_python = "@azure-tools/typespec-python"
517
517
# call scirpt to generate sdk
518
518
try :
519
+ tsp_client = "npx --prefix eng/common/tsp-client tsp-client"
519
520
if spec_folder :
520
521
tsp_dir = (Path (spec_folder ) / typespec_relative_path ).resolve ()
521
522
repo_url = rest_repo_url .replace ("https://github.com/" , "" )
@@ -527,15 +528,15 @@ def gen_typespec(
527
528
content ["options" ]["@azure-tools/typespec-python" ]["api-version" ] = api_version
528
529
with open (tspconfig , "w" ) as file_out :
529
530
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 } "
531
532
else :
532
533
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 } "
534
535
if run_in_pipeline :
535
536
emitter_name = "@azure-tools/typespec-python"
536
537
if not os .path .exists (f"node_modules/{ emitter_name } " ):
537
538
_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 )
539
540
else :
540
541
_LOGGER .info (f"skip install since { emitter_name } is already installed" )
541
542
cmd += " --skip-install --debug"
0 commit comments