3
3
using System . Collections . Generic ;
4
4
using System . Diagnostics ;
5
5
using System . IO ;
6
+ using System . Net ;
6
7
using System . Text ;
7
8
8
9
public bool RunCommand ( string cmd , bool showCmd = false , bool logOnErrorOnly = false ) {
@@ -116,7 +117,7 @@ if (triggerCloudBuild) {
116
117
}
117
118
118
119
119
- Console . WriteLine ( string . Format ( "GITHUB_TOKEN: {0} set" , string . IsNullOrWhiteSpace ( githubToken ) ? "not" : "is" ) ) ;
120
+ Console . WriteLine ( string . Format ( "GITHUB_TOKEN: {0} set" , string . IsNullOrWhiteSpace ( githubToken ) ? "not" : "is" ) ) ;
120
121
Console . WriteLine ( $ "%UNITYPACKAGER_RAISE_ERROR_ON_FAILURE%: { raiseErrorOnFailure } ") ;
121
122
Console . WriteLine ( $ "%APPVEYOR_BUILD_FOLDER%: { rootDir } ") ;
122
123
Console . WriteLine ( $ "%APPVEYOR_REPO_COMMIT_MESSAGE%: { commitMessage } ") ;
@@ -135,7 +136,7 @@ if (!triggerCloudBuild) {
135
136
Console . WriteLine ( $ "sdkproject directory: { projectDir } ") ;
136
137
137
138
Environment . CurrentDirectory = projectDir ;
138
- if ( ! RunCommand ( "del /F /S /Q .gitignore" ) ) {
139
+ if ( ! RunCommand ( "del /F /S /Q .gitignore" ) ) {
139
140
Console . Error . WriteLine ( "could not delete .gitignore" ) ;
140
141
Environment . Exit ( 1 ) ;
141
142
}
@@ -177,8 +178,17 @@ if (!triggerCloudBuild) {
177
178
178
179
//---------- documentation
179
180
Console . WriteLine ( "downloading docfx ..." ) ;
180
- if ( ! RunCommand ( "powershell Invoke-WebRequest https://github.com/dotnet/docfx/releases/download/v2.14.1/docfx.zip -OutFile docfx.zip" , true , true ) ) {
181
- Console . Error . WriteLine ( "could not download docfx" ) ;
181
+ try {
182
+ ServicePointManager . Expect100Continue = true ;
183
+ ServicePointManager . SecurityProtocol = SecurityProtocolType . Tls12 ;
184
+ using ( WebClient wc = new WebClient ( ) ) {
185
+ wc . DownloadFile (
186
+ "https://github.com/dotnet/docfx/releases/download/v2.14.1/docfx.zip"
187
+ , "docfx.zip"
188
+ ) ;
189
+ }
190
+ } catch ( Exception ex ) {
191
+ Console . Error . WriteLine ( "could not download docfx: " + ex . ToString ( ) ) ;
182
192
Environment . Exit ( 1 ) ;
183
193
}
184
194
0 commit comments