Skip to content

Commit

Permalink
add Upgrade_20210828_ExtensionsLoveFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
olmobrutall committed Aug 27, 2021
1 parent b7848ef commit 18837c0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions Signum.Upgrade/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static void Main(string[] args)
new Upgrade_20210726_SimplifyDockerBuild(),
new Upgrade_20210816_RemoveWebAuth(),
new Upgrade_20210824_UpdateNugets(),
new Upgrade_20210828_ExtensionsLoveFramework(),
}.Run(uctx);
}
}
Expand Down
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");
}
}
}
}

0 comments on commit 18837c0

Please sign in to comment.