Skip to content

Commit

Permalink
fix: Search path for apply file should be relative to the project-pat…
Browse files Browse the repository at this point in the history
…h setting it it exists
  • Loading branch information
normj committed Oct 27, 2021
1 parent 3973b24 commit c4fad95
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/AWS.Deploy.CLI/Commands/CommandFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,22 @@ private Command BuildDeployCommand()
_toolInteractiveService.Diagnostics = input.Diagnostics;
_toolInteractiveService.DisableInteractive = input.Silent;
var userDeploymentSettings = !string.IsNullOrEmpty(input.Apply)
? UserDeploymentSettings.ReadSettings(input.Apply)
: null;
var projectDefinition = await _projectParserUtility.Parse(input.ProjectPath ?? "");
var targetApplicationDirectoryPath = new DirectoryInfo(projectDefinition.ProjectPath).Parent!.FullName;
UserDeploymentSettings? userDeploymentSettings = null;
if (!string.IsNullOrEmpty(input.Apply))
{
var applyPath = Path.GetFullPath(input.Apply, targetApplicationDirectoryPath);
userDeploymentSettings = UserDeploymentSettings.ReadSettings(applyPath);
}
var awsCredentials = await _awsUtilities.ResolveAWSCredentials(input.Profile ?? userDeploymentSettings?.AWSProfile);
var awsRegion = _awsUtilities.ResolveAWSRegion(input.Region ?? userDeploymentSettings?.AWSRegion);
_commandLineWrapper.RegisterAWSContext(awsCredentials, awsRegion);
_awsClientFactory.RegisterAWSContext(awsCredentials, awsRegion);
var projectDefinition = await _projectParserUtility.Parse(input.ProjectPath ?? "");
var callerIdentity = await _awsResourceQueryer.GetCallerIdentity();
var session = new OrchestratorSession(
Expand Down Expand Up @@ -217,7 +221,6 @@ private Command BuildDeployCommand()
var deploymentProjectPath = input.DeploymentProject ?? string.Empty;
if (!string.IsNullOrEmpty(deploymentProjectPath))
{
var targetApplicationDirectoryPath = new DirectoryInfo(projectDefinition.ProjectPath).Parent!.FullName;
deploymentProjectPath = Path.GetFullPath(deploymentProjectPath, targetApplicationDirectoryPath);
}
Expand Down

0 comments on commit c4fad95

Please sign in to comment.