Browse Source

Quote path arguments of commands. (#650)

finitereality/replica-status-colors
Christian Kadluba 6 years ago
committed by GitHub
parent
commit
8626d68bef
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Microsoft.Tye.Core/ApplicationFactory.cs
  2. 2
      src/Microsoft.Tye.Hosting/DockerRunner.cs

2
src/Microsoft.Tye.Core/ApplicationFactory.cs

@ -201,7 +201,7 @@ namespace Microsoft.Tye
throw new CommandException($"Cannot clone repository {configService.Repository} because git is not installed. Please install git if you'd like to use \"repository\" in tye.yaml.");
}
var result = await ProcessUtil.RunAsync("git", $"clone {configService.Repository} {clonePath}", workingDirectory: path, throwOnError: false);
var result = await ProcessUtil.RunAsync("git", $"clone {configService.Repository} \"{clonePath}\"", workingDirectory: path, throwOnError: false);
if (result.ExitCode != 0)
{

2
src/Microsoft.Tye.Hosting/DockerRunner.cs

@ -291,7 +291,7 @@ namespace Microsoft.Tye.Hosting
}
}
var command = $"run -d {workingDirectory} {volumes} {environmentArguments} {portString} --name {replica} --restart=unless-stopped {dockerImage} {docker.Args ?? ""}";
var command = $"run -d \"{workingDirectory}\" {volumes} {environmentArguments} {portString} --name {replica} --restart=unless-stopped {dockerImage} {docker.Args ?? ""}";
_logger.LogInformation("Running image {Image} for {Replica}", docker.Image, replica);

Loading…
Cancel
Save