Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/openshift/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,17 +524,12 @@ export class Component extends OpenShiftItem {
}

if (!workspacePath) return null;

const paths = globby.sync(workspacePath.path, {
expandDirectories: {
files: ['*'],
extensions: ['jar', 'war']
}
});
const globPath = process.platform === 'win32' ? workspacePath.fsPath.replace(/\\/g, '/') : workspacePath.path;
const paths = globby.sync(`${globPath}/*.+(jar|war)`, { extglob: true });

if (paths.length === 0) return window.showInformationMessage("No binary file present in the context folder selected. We currently only support .jar and .war files. If you need support for any other file, please raise an issue.");

const binaryFileObj: QuickPickItem[] = paths.map((file) => ({ label: `$(file-zip) ${file.split('/').pop()}`, description: `${file}`}));
const binaryFileObj: QuickPickItem[] = paths.map((file) => ({ label: `$(file-zip) ${path.basename(file)}`, description: `${file}`}));

const binaryFile: any = await window.showQuickPick(binaryFileObj, {placeHolder: "Select binary file"});

Expand Down