Skip to content

[Git Repos] Fails when the scan path contains a space #8829

@nitishpdmn

Description

@nitishpdmn

Extension

https://www.raycast.com/moored/git-repos

Description

When the path to scan contains a space in the name, it will successfully find the path where it checks for validity, but then it will fail to list any of the subdirectories. I believe I already have the fix for it:

diff --git a/src/utils.tsx b/src/utils.tsx
index 738353c..f18aa95 100644
--- a/src/utils.tsx
+++ b/src/utils.tsx
@@ -208,7 +208,7 @@ export async function findRepos(paths: string[], maxDepth: number, includeSubmod
   let foundRepos: GitRepo[] = [];
   await Promise.allSettled(
     paths.map(async (path) => {
-      const findCmd = `find -L ${path} -maxdepth ${maxDepth} -name .git -type d`;
+      const findCmd = `find -L "${path}" -maxdepth ${maxDepth} -name .git -type d`;
       const { stdout, stderr } = await execp(findCmd);
       if (stderr) {
         showToast(Toast.Style.Failure, "Find Failed", stderr);

Steps To Reproduce

Set the "Path to scan for Git Repos" setting to anything with a space in it

Current Behaviour

No response

Expected Behaviour

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingextensionIssues related to one of the extensions in the Storeextension: git-reposIssues related to the git-repos extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions