Skip to content

Commit

Permalink
fixes for folder and image selection
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Drage <[email protected]>
  • Loading branch information
cdrage committed Jan 9, 2024
1 parent 9599987 commit 5071309
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
"badges/imagesList": [
{
"when": "ostree.bootable in imageLabelKeys",
"badge": "bootable"
"badge": {
"name": "bootc",
"style": "bg-green-600"
}
}
]
}
Expand Down
7 changes: 4 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import type { ContainerCreateOptions, ExtensionContext } from '@podman-desktop/api';
import * as extensionApi from '@podman-desktop/api';
import { BootC } from './bootc';
import * as os from 'node:os';

let bootc: BootC | undefined;
const bootcImageBuilderContainerName = '-bootc-image-builder';
Expand All @@ -32,15 +33,15 @@ export async function activate(extensionContext: ExtensionContext): Promise<void

extensionContext.subscriptions.push(
extensionApi.commands.registerCommand('bootc.image.build', async image => {
const selectedType = await extensionApi.window.showQuickPick(['.oci', '.qcow2', '.ami', '.iso'], {
const selectedType = await extensionApi.window.showQuickPick(['qcow2', 'ami', 'iso'], {
placeHolder: 'Select image type',
});
if (!selectedType)
return;

const selectedFolder = await extensionApi.window.showInputBox({
prompt: 'Select the folder to generate disk' + selectedType + ' into',
value: '~/',
value: os.homedir(),
ignoreFocusOut: true,
});
if (!selectedFolder)
Expand Down Expand Up @@ -146,7 +147,7 @@ let options: ContainerCreateOptions = {
// Outputs to:
// <type>/disk.<type>
// in the directory provided
Cmd: [image.name,"--output","/tmp/"],
Cmd: [image.name,"--type", type, "--output","/tmp/" + type],
};
try {
await extensionApi.containerEngine.createContainer(image.engineId, options);
Expand Down

0 comments on commit 5071309

Please sign in to comment.