Merge pull request #7330 from abpframework/auto-merge/rel-4-2/104

Merge branch dev with rel-4.2
pull/7334/head
maliming 5 years ago committed by GitHub
commit 0154a161b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,12 +26,16 @@ namespace Volo.Abp.Cli.Commands
throw new Exception("DbMigrator is not found!");
}
var output = CmdHelper.RunCmdAndGetOutput("cd \"" + commandLineArgs.Target + "\" && dotnet ef migrations add Initial -s " + dbMigratorProjectPath);
var output = CmdHelper.RunCmdAndGetOutput($"cd \"{commandLineArgs.Target}\" && dotnet ef migrations add Initial -s \"{dbMigratorProjectPath}\"");
if (output.Contains("Done.") && output.Contains("To undo this action") && output.Contains("ef migrations remove")) // Migration added successfully
{
CmdHelper.RunCmd("cd \"" + Path.GetDirectoryName(dbMigratorProjectPath) + "\" && dotnet run");
}
else
{
throw new Exception("Migrations failed: " + output);
}
}
private string GetDbMigratorProjectPath(string dbMigrationsFolderPath)

@ -47,7 +47,7 @@ namespace Volo.Abp.Cli.Utils
{
process.StartInfo = new ProcessStartInfo(CmdHelper.GetFileName())
{
Arguments = CmdHelper.GetArguments(command),
Arguments = GetArguments(command),
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,

@ -141,7 +141,7 @@ namespace MyCompanyName.MyProjectName.Data
}
var procStartInfo = new ProcessStartInfo( fileName,
$"{argumentPrefix} \"abp create-migration-and-run-migrator {GetDbMigrationsProjectFolderPath()}\""
$"{argumentPrefix} \"abp create-migration-and-run-migrator \"{GetDbMigrationsProjectFolderPath()}\"\""
);
try

Loading…
Cancel
Save