Skip to content
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

Fixes #337 - Command fix for project path with spaces #355

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

SuparnaSuresh
Copy link

@SuparnaSuresh SuparnaSuresh commented Oct 22, 2024

Fixes #337
Fix for the issue - 'No such file or directory' raised for the start, start in container and start .. action of LTV dashboard for a project opened from the directory with space and project name with space.


import * as Path from "path";
import * as vscode from "vscode";
import { isWin,mvnCmd,gradleCmd } from "../liberty/devCommands";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the need to import methods isWin, mvnCmd and gradleCmd in commandUtils. These methods are never used in devCommands and elsewhere in the project. So in my suggestion you can remove these methods from devCommands and keep it in commandUtils. This can reduce one unnecessary import and improve performance.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment incorporated. Moved unused methods from devCommands to commandUtils and removed import.
Thanks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Thanks

* https://github.com/microsoft/vscode-maven/blob/main/src/mavenTerminal.ts
*/
function currentWindowsShell(): ShellType {
const currentWindowsShellPath: string = vscode.env.shell;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this return? Is it the default terminal or current terminal? What if there are multiple terminals opened in the vs code? Will it return the current terminal?

Copy link
Author

@SuparnaSuresh SuparnaSuresh Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will return the default terminal details.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm that we require the default terminal instead of current terminal.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the existing behavior, even if we open multiple type of terminals in vscode, when we perform actions in liberty dashboard, commands will execute in the default terminal type. So we need to get default terminal details to decide the format of command.

TerminalBehavior.mov

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Thanks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Thanks.

* Return the maven commands based on the OS and Terminal for start, startinContainer, start..
*/

export async function getCommandForMaven(pomPath: string,command:string,customCommand?: string) : Promise<string> {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly fix the indentations.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the indentation.
Thanks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mvnCmd and gradleCmd should quote executable paths
2 participants