path confusions

This commit is contained in:
2021-12-06 13:12:14 +01:00
parent c6fb7b498f
commit ebc5018b22
3 changed files with 10 additions and 3 deletions

View File

@ -91,9 +91,15 @@ if [ "$STAGE2" = "1" ]; then
sed -i output/src/$PACKAGE_NAME/Startup.cs \
-e 's#\(using '$PACKAGE_NAME'.OpenApi;\)#\1\n\n// added by post-processor\nusing '$PACKAGE_NAME'.Services;\n#' \
-e 's#^\([[:space:]]*\)\(// Add framework services.\)#\1// added by post-processor\n\1services.AddTransient<IDbService, DbService>();\n\n\1\2#' \
-e 's#\(c.RoutePrefix = "\)openapi\(";\)#\1'$ROUTE_PREFIX'/doc\2#' \
-e 's#\(c.RoutePrefix = "\)openapi\(";\)#\1'$ROUTE_PREFIX'/api/doc\2#' \
-e 's#\(c.SwaggerEndpoint("\)/openapi/2.0.0/openapi.json\(", "Generic Database API Service");\)#\1'$ROUTE_PREFIX'/api/openapi/JSON\2#' \
-e 's#\(c.RouteTemplate = "\)openapi/{documentName}/openapi.json\(";\)#\1'$ROUTE_PREFIX'/api/openapi/JSON\2#' \
-e 's#\(app.UseHttpsRedirection();\)#// \1#'
echo "fix root redirect in index.html"
sed -i output/src/$PACKAGE_NAME/wwwroot/index.html \
-e 's#openapi#'$ROUTE_PREFIX'/api/doc#'
echo "disable documentation warnings in generated code"
sed -i output/src/$PACKAGE_NAME/$PACKAGE_NAME.csproj \
-e 's#\(</PropertyGroup>\)#<NoWarn>1591</NoWarn>\n\1#'