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

account for special var workspaceFolder in Worktrees directory path #38

Open
mischadiehm opened this issue May 26, 2024 · 1 comment
Open

Comments

@mischadiehm
Copy link

It would be nice if the code respected the special var: ${workspacefolder}/ in the path so we can keep the worktrees local to the repos. What do you think?

image

I'm not a ts code programmer. This was generated by chatgpt but sth like:

export const calculateNewWorktreePathNew = async (workspaceFolder, branch) => {
    try {
        // Resolve ${workspaceFolder} if present in the input path
        if (workspaceFolder.includes('${workspaceFolder}')) {
            const resolvedWorkspaceFolder = vscode.workspace.workspaceFolders?.[0].uri.fsPath;
            if (resolvedWorkspaceFolder) {
                workspaceFolder = workspaceFolder.replace('${workspaceFolder}', resolvedWorkspaceFolder);
            } else {
                throw new Error('Workspace folder could not be resolved.');
            }
        }
        ...
@alexiszamanidis
Copy link
Owner

Hi @mischadiehm,

Could you please provide details on how you currently use ${workspaceFolder}, the issues you are encountering with this setup, and specific examples of how you would like it to work in the desired implementation? Any additional insights into your workflow and needs would be helpful.

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

No branches or pull requests

2 participants