File tree 1 file changed +5
-7
lines changed
Skyline.DataMiner.CICD.Tools.GitHubToCatalogYaml
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -316,17 +316,15 @@ private static string InferArtifactContentType(string keyword)
316
316
private void SaveFile ( CatalogYaml catalogYaml , ISerializer serializer , string outputPath )
317
317
{
318
318
logger . LogDebug ( $ "Serializing and saving the updated catalog.yml file with path: { outputPath } .") ;
319
-
319
+ // Delete the file if it already exists. Overwriting an existing file is not allowed in GitHub.
320
+ fs . File . DeleteFile ( outputPath ) ;
321
+ Thread . Sleep ( 500 ) ;
320
322
var updatedYaml = serializer . Serialize ( catalogYaml ) ;
321
- fs . Directory . CreateDirectory ( outputPath ) ;
322
- var parentDir = fs . File . GetParentDirectory ( outputPath ) ;
323
323
324
- // Required by GitHub to change existing files.
324
+ var parentDir = fs . Path . GetDirectoryName ( outputPath ) ;
325
+ fs . Directory . CreateDirectory ( parentDir ) ;
325
326
fs . Directory . TryAllowWritesOnDirectory ( parentDir ) ;
326
327
327
- // Delete the file if it already exists. Overwriting an existing file is not allowed in GitHub.
328
- fs . File . DeleteFile ( outputPath ) ;
329
- Thread . Sleep ( 500 ) ;
330
328
fs . File . WriteAllText ( outputPath , updatedYaml ) ;
331
329
}
332
330
}
You can’t perform that action at this time.
0 commit comments