Skip to content

Commit

Permalink
Fix issue #121: Allow resetting base tag
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Dec 16, 2024
1 parent dfcb3c1 commit d964a2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Commands/Commit/CommitCliCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ await Spinner.StartAsync("Launching image", async _ =>
baseTag = image.BaseImage?.Tag;
}

baseTag = container.GetLabel(Constants.BaseTagLabel) ?? baseTag ?? image?.Tag;
baseTag = settings.BaseTag ?? container.GetLabel(Constants.BaseTagLabel) ?? baseTag ?? image?.Tag;

Check failure on line 148 in src/Commands/Commit/CommitCliCommand.cs

View workflow job for this annotation

GitHub Actions / build

The name 'settings' does not exist in the current context

Check failure on line 148 in src/Commands/Commit/CommitCliCommand.cs

View workflow job for this annotation

GitHub Actions / build

The name 'settings' does not exist in the current context

var tagPrefix = container.TagPrefix;
var newTag = baseTag == null ? tag : $"{tagPrefix}{baseTag}-{tag}";
Expand All @@ -164,4 +164,4 @@ await Spinner.StartAsync("Launching image", async _ =>
var identifier = _containerNamePrompt.GetIdentifierOfContainerFromUser(containers, "commit");
return containers.SingleOrDefault(c => c.ContainerName == identifier);
}
}
}
5 changes: 4 additions & 1 deletion src/Commands/Commit/CommitSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ public class CommitSettings : CommandSettings, IContainerIdentifierSettings

[CommandOption("-o|--overwrite")]
public bool Overwrite { get; set; }
}

[CommandOption("-b|--base-tag")]
public string? BaseTag { get; set; }
}

0 comments on commit d964a2c

Please sign in to comment.