Feature: Allow for cli version specification#253
Open
Olgethorpe wants to merge 5 commits intodevcontainers:mainfrom
Open
Feature: Allow for cli version specification#253Olgethorpe wants to merge 5 commits intodevcontainers:mainfrom
Olgethorpe wants to merge 5 commits intodevcontainers:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree company="M Science LLC" |
chrmarti
requested changes
Dec 13, 2023
Collaborator
chrmarti
left a comment
There was a problem hiding this comment.
Thanks for the PR! I have left a few comments. Could you take a look and address them. Thanks!
common/src/dev-container-cli.ts
Outdated
| }); | ||
| return exitCode === 0; | ||
| const {exitCode, stdout} = await exec(getSpecCliInfo().command, ['--version'], {}); | ||
| return exitCode === 0 && stdout === cliVersion; |
Collaborator
There was a problem hiding this comment.
Could stdout include a newline? Maybe use .trim() on the string.
Author
There was a problem hiding this comment.
Good point, I have addressed the change.
chrmarti
requested changes
Feb 7, 2025
Collaborator
chrmarti
left a comment
There was a problem hiding this comment.
Sorry, long delay, but this would still be useful. Left a few more questions.
| description: Builds the image with `--no-cache` (takes precedence over `cacheFrom`) | ||
| cliVersion: | ||
| required: false | ||
| default: latest |
| }); | ||
| return exitCode === 0; | ||
| const {exitCode, stdout} = await exec(command, ['--version'], {}); | ||
| return exitCode === 0 && stdout.trim() === cliVersion; |
Collaborator
There was a problem hiding this comment.
=== won't match, e.g., major version 0 with any actual x.y.z version. 🤔
| import {findWindowsExecutable} from './windows'; | ||
|
|
||
| const cliVersion = "0"; // Use 'latest' to get latest CLI version, or pin to specific version e.g. '0.14.1' if required | ||
| export const MAJOR_VERSION_FALLBACK = '0'; |
This file contains hidden or 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
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.
This is in the context of devcontainers/cli#606.
I think this should be enough to allow for CLI version specification according to the other code I saw while reading through this.
The local build in the devcontainer is passing.