Skip to content

Commit 3541b2e

Browse files
authored
compatible with data-plan (#16442)
1 parent 599d3b8 commit 3541b2e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tools/azure-sdk-tools/packaging_tools/auto_codegen.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ def get_package_names(sdk_folder):
2525

2626

2727
def init_new_service(package_name, folder_name):
28-
ci = Path(folder_name, 'ci.yml')
29-
if not ci.exists():
28+
setup = Path(folder_name, package_name, 'setup.py')
29+
if not setup.exists():
3030
check_call(f'python -m packaging_tools --build-conf {package_name} -o {folder_name}', shell=True)
31-
with open('ci_template.yml', 'r') as file_in:
32-
content = file_in.readlines()
33-
name = package_name.replace('azure-', '').replace('mgmt-', '')
34-
content = [line.replace('MyService', name) for line in content]
35-
with open(str(ci), 'w') as file_out:
36-
file_out.writelines(content)
31+
ci = Path(folder_name, 'ci.yml')
32+
if not ci.exists():
33+
with open('ci_template.yml', 'r') as file_in:
34+
content = file_in.readlines()
35+
name = package_name.replace('azure-', '').replace('mgmt-', '')
36+
content = [line.replace('MyService', name) for line in content]
37+
with open(str(ci), 'w') as file_out:
38+
file_out.writelines(content)
3739

3840

3941
def main(generate_input, generate_output):

0 commit comments

Comments
 (0)