Browse Source
Merge pull request #1390 from abpframework/maliming/patch-1
Use a regular expression to get the package name.
pull/1394/head
Halil İbrahim Kalkan
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
4 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/NugetReferenceReplaceStep.cs
|
|
@ -1,6 +1,7 @@ |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.IO; |
|
|
using System.IO; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
|
|
|
using System.Text.RegularExpressions; |
|
|
using HtmlAgilityPack; |
|
|
using HtmlAgilityPack; |
|
|
using Volo.Abp.Cli.ProjectBuilding.Files; |
|
|
using Volo.Abp.Cli.ProjectBuilding.Files; |
|
|
|
|
|
|
|
|
@ -92,11 +93,13 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building.Steps |
|
|
|
|
|
|
|
|
private string ConvertToNugetReference(string oldValue) |
|
|
private string ConvertToNugetReference(string oldValue) |
|
|
{ |
|
|
{ |
|
|
var directory = new DirectoryInfo(oldValue); |
|
|
var newValue = Regex.Match(oldValue, @"\\((?!.+?\\).+?)\.csproj"); |
|
|
|
|
|
if (newValue.Success && newValue.Groups.Count == 2) |
|
|
var newValue = directory.Name.Replace(".csproj", ""); |
|
|
{ |
|
|
|
|
|
return newValue.Groups[1].Value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return newValue; |
|
|
return oldValue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static Stream GenerateStreamFromString(string s) |
|
|
private static Stream GenerateStreamFromString(string s) |
|
|
|