Skip to content

Conversation

Salvatore112
Copy link
Contributor

@Salvatore112 Salvatore112 commented May 2, 2025

Улучшения:

  1. Убрал кириллицу, т.к. с ней скрипт падал
  2. По старой ссылке не находился .jar файл -- заменил на новую
  3. Убрал лишнюю "}"

@Salvatore112 Salvatore112 requested review from DedSec256 and bygu4 May 2, 2025 04:31
$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"
Copy link
Contributor

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()
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему бы не сразу записать в Destination?

@DedSec256
Copy link
Contributor

Не очень понял, какая проблема с ссылкой на jar? Проблемы с доступом и требуется впн?

@Salvatore112
Copy link
Contributor Author

Не очень понял, какая проблема с ссылкой на jar? Проблемы с доступом и требуется впн?

У меня он просто не может резолвнуть ссылку :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants