-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert default command template values into ShellQuotedString format #4433
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bwateratmsft
previously approved these changes
Dec 18, 2024
bwateratmsft
approved these changes
Dec 18, 2024
bwateratmsft
requested changes
Dec 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synced offline, this needs some adjustment:
vscode-docker/src/commands/images/buildImage.ts
Lines 52 to 69 in 62dcfc5
if (tagRegex.test(terminalCommand.command)) { | |
const absFilePath: string = path.join(rootFolder.uri.fsPath, dockerFileItem.relativeFilePath); | |
const dockerFileKey = `buildTag_${absFilePath}`; | |
const prevImageName: string | undefined = ext.context.workspaceState.get(dockerFileKey); | |
// Get imageName based previous entries, else on name of subfolder containing the Dockerfile | |
const suggestedImageName = prevImageName || getValidImageNameFromPath(dockerFileItem.absoluteFolderPath, 'latest'); | |
// Temporary work-around for vscode bug where valueSelection can be messed up if a quick pick is followed by a showInputBox | |
await delay(500); | |
addImageTaggingTelemetry(context, suggestedImageName, '.before'); | |
const imageName: string = await getTagFromUserInput(context, suggestedImageName); | |
addImageTaggingTelemetry(context, imageName, '.after'); | |
await ext.context.workspaceState.update(dockerFileKey, imageName); | |
terminalCommand.command = terminalCommand.command.replace(tagRegex, imageName); | |
} |
bwateratmsft
previously approved these changes
Dec 19, 2024
bwateratmsft
approved these changes
Dec 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a task command template has the default value, this attempts to parse it and convert into a ShellQuotedString format so that VSCode will perform appropriate argument escaping for the selected shell. The current logic will only run if a task is configured with the default value as the current parsing logic assumes certain conditions that may not be true for a user customized value.
This should resolve #4291.