-
Notifications
You must be signed in to change notification settings - Fork 319
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
fix: add implementation for compose update #9402
Conversation
Signed-off-by: Denis Golovin <dgolovin@redhat.com>
@@ -44,7 +44,7 @@ export function getSystemBinaryPath(binaryName: string): string { | |||
} | |||
|
|||
// Takes a binary path (e.g. /tmp/docker-compose) and installs it to the system. Renames it based on binaryName | |||
export async function installBinaryToSystem(binaryPath: string, binaryName: string): Promise<void> { | |||
export async function installBinaryToSystem(binaryPath: string, binaryName: string): Promise<string | undefined> { |
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.
should not be Promise<string | undefined> the signature should always return a string, if the function was not able to install system-wide (user cancel, or refuse to give admin privilege) it should throw an error
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.
@axel7083 I'll open follow up on this, because I don't want add too much new functionality to the fix.
await composeDownload.download(releaseToUpdateTo); | ||
// get the binary in the extension folder | ||
const storagePath = await detect.getStoragePath(); | ||
binaryPath = await installBinaryToSystem(storagePath, composeCliName); |
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.
try {
// try to install system wide
} catch {
// log the error
} finally {
// update the composeCliTool with either the path from the extension folder or the system wide if install success
}
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.
Same as previous comment.
What does this PR do?
Implements update support for compose CLI
Screenshot / video of UI
What issues does this PR fix or reference?
Fix #8838.
How to test this PR?