-
Notifications
You must be signed in to change notification settings - Fork 16
Улучшение скрипта для генерации API #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
$generatorUrl = "https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.68/swagger-codegen-cli-3.0.68.jar" | ||
$generatorUrls = @( | ||
"https://repo.maven.apache.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.68/swagger-codegen-cli-3.0.68.jar", | ||
"https://mirrors.ocf.berkeley.edu/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.68/swagger-codegen-cli-3.0.68.jar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вторую ссылку не находит
# 2. Делаем конфигурацию опциональной | ||
$apiContent = $apiContent -replace 'configuration:\s*Configuration;', 'configuration: Configuration | undefined;' | ||
$apiContent = $apiContent -replace '\t', ' ' | ||
$apiContent = $apiContent.TrimEnd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так только в конце файла удалятся пробелы --- надо получать массив строк и делать ForEach
$apiContent | Set-Content -Path $apiFilePath -Encoding UTF8 -Force | ||
} else { | ||
Write-Warning "Файл api.ts не найден по пути $apiFilePath для выполнения замен." | ||
Move-Item -Path $apiFile.FullName -Destination $apiDestination -Force -ErrorAction Stop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему бы не сразу записать в Destination?
Не очень понял, какая проблема с ссылкой на jar? Проблемы с доступом и требуется впн? |
У меня он просто не может резолвнуть ссылку :/ |
Улучшения: