-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Upgrade_20210828_ExtensionsLoveFramework
- Loading branch information
1 parent
b7848ef
commit 18837c0
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
Signum.Upgrade/Upgrades/Upgrade_20210828_ExtensionsLoveFramework.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using Signum.Utilities; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Security.Cryptography.X509Certificates; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Signum.Upgrade.Upgrades | ||
{ | ||
class Upgrade_20210828_ExtensionsLoveFramework : CodeUpgradeBase | ||
{ | ||
public override string Description => "Extensions ❤️ Framework"; | ||
|
||
public override void Execute(UpgradeContext uctx) | ||
{ | ||
uctx.ForeachCodeFile(@"*.csproj", file => | ||
{ | ||
file.Replace(@"\Extensions\", @"\Framework\"); | ||
}); | ||
|
||
uctx.ForeachCodeFile(@"*.sln", file => | ||
{ | ||
file.Replace(@"""Extensions\", @"""Framework\"); | ||
}); | ||
|
||
uctx.ChangeCodeFile(@"Southwind.React\webpack.config.js", file => | ||
{ | ||
file.Replace(@"\Extensions\", @"\Framework\"); | ||
}); | ||
|
||
uctx.ChangeCodeFile(@"Southwind.React/tsconfig.json", file => | ||
{ | ||
file.Replace(@"/Extensions/", @"/Framework/"); | ||
}); | ||
|
||
uctx.ChangeCodeFile(@"Southwind.React/package.json", file => | ||
{ | ||
file.Replace(@"/Extensions/", @"/Framework/"); | ||
}); | ||
|
||
uctx.ChangeCodeFile(@".gitmodules", file => | ||
{ | ||
file.RemoveAllLines(a => a.Contains("extensions", StringComparison.InvariantCultureIgnoreCase)); | ||
}); | ||
|
||
if (SafeConsole.Ask("Do you want to delete 'Extensions' folder with all his content?")) | ||
{ | ||
Directory.Delete(Path.Combine(uctx.RootFolder, "Extensions"), true); | ||
Console.WriteLine("deleted"); | ||
} | ||
} | ||
} | ||
} |