extensions
extensions copied to clipboard
[Github] Unable to clone and open new repositories using hotkey
Extension
https://www.raycast.com/raycast/github
Raycast Version
1.88.3
macOS Version
15.2
Description
Can't Clone and Open a new repository in GitHub search-repositories
error:
worked before seems broken since latest Mac OS or Raycast Extension Update
Path to Clone into is set as before:
manually cloning via gh cli works
Steps To Reproduce
Open Raycast Use Search Repositories from GitHub extension Select a new repository that's not in you local storage press opt + cmd + c to "clone and open"
Current Behaviour
Can't clone new repositories with clone and open command pulling existing repositories works fine
Expected Behaviour
need to be able to clone non existing repositories via clone and open again
Thank you for opening this issue!
🔔 @unnamedd @tonka3000 @khasbilegt @pernielsentikaer @loxygenK @oilbeater @LunaticMuch @aeorge @daquinoaldo @peppy @aeither @marcotf @qeude @nesl247 @xilopaint @antonengelhardt @bangerang @wottpal @LitoMore @d-mitrofanov-v @j3lte @jfkisafk @vlasischar @JavaLangRuntimeException @shyakadavis @sushichan044 you might want to have a look.
💡 Author and Contributors commands
The author and contributors of raycast/github can trigger bot actions by commenting:
@raycastbot close this issueCloses the issue.@raycastbot close as not plannedCloses the issue as not planned.@raycastbot rename this issue to "Awesome new title"Renames the issue.@raycastbot reopen this issueReopens the issue.@raycastbot assign meAssigns yourself to the issue.@raycastbot good first issueAdds the "Good first issue" label to the issue.@raycastbot keep this issue openMake sure the issue won't go stale and will be kept open by the bot.
Could you share a recording? It'll make it easier to see what's happening.
https://github.com/user-attachments/assets/e0b29b07-8c38-440c-824e-1350cabbeaf6
as you can see im trying to "Clone And Open" a Repo that is not currently in my local file system.
This ends in the error:
my Clone Path is set as usual, nothing changed there:
And when I execute the same command manually it works as intended. Seems as if "Clone And Open" doesn't use the configured folder anymore.
Yes, the Raycast process (and the child process it spawns) does not have permissions to create a folder in the file system.
export async function cloneAndOpen(repository: ExtendedRepositoryFieldsFragment) {
const { application, baseClonePath, repositoryCloneProtocol } = getPreferenceValues<Preferences.SearchRepositories>();
console.log("baseClonePath", baseClonePath);
const applicationPath = application?.path.replaceAll(" ", "\\ ");
const clonePath = `${baseClonePath}/${repository.nameWithOwner}`;
console.log("clonePath", clonePath);
const openCommand = `open -a ${applicationPath} ${clonePath}`;
// ...
if (!existsSync(clonePath.replace("~", homedir()))) {
const cloneCommand = buildCloneCommand(repository.nameWithOwner, repositoryCloneProtocol);
try {
execSync(cloneCommand);
} catch (error) {
toast.style = Toast.Style.Failure;
toast.title = "Error while cloning the repository";
toast.message = getErrorMessage(error);
console.error(error);
return;
}
}
// ...
export const buildCloneCommand = (
repoNameWithOwner: string,
cloneProtocol: AcceptableCloneProtocol,
options?: Partial<AdditionalCloneFormatOptions>,
): string => {
const gitFlag = options?.gitFlags?.join(" ") ?? "";
const targetDir = options?.targetDir ?? "";
const cloneUrl = formatRepositoryUrl(repoNameWithOwner, cloneProtocol);
return `git clone ${gitFlag} ${cloneUrl} ${targetDir}`;
};
[0] 11:06:18.520 baseClonePath /Users/antonengelhardt/Documents/repos
[0] 11:06:18.520 clonePath /Users/antonengelhardt/Documents/repos/raycast/ripgrep
[0] 11:06:18.619 Error: Command failed: git clone https://github.com/raycast/ripgrep.git
[0] fatal: could not create work tree dir 'ripgrep': Read-only file system
I've looked at it, and I can reproduce it indeed. Using the Clone with Options form seems to work though, so there's probably something in the Clone and Open action that's not been updated or doesn't work. Would one of you be able to look at it? I'm busy with other projects at the moment, so it's hard to dedicate some time to that.
@thomaslombart I will take a look.