add lint command to package.json (#864)

This commit is contained in:
Gabriel Gordon-Hall
2025-09-26 12:33:40 +01:00
committed by GitHub
parent b5b7fd5aa3
commit 2374e470d4
3 changed files with 11 additions and 5 deletions

View File

@@ -1777,6 +1777,8 @@ impl GitService {
target_path: &Path,
token: Option<&str>,
) -> Result<Repository, GitServiceError> {
use git2::{Cred, FetchOptions, RemoteCallbacks};
if let Some(parent) = target_path.parent() {
std::fs::create_dir_all(parent)?;
}
@@ -1791,11 +1793,12 @@ impl GitService {
// Fallback to SSH agent and key file authentication
callbacks.credentials(|_url, username_from_url, _| {
// Try SSH agent first
if let Some(username) = username_from_url {
if let Ok(cred) = Cred::ssh_key_from_agent(username) {
return Ok(cred);
}
if let Some(username) = username_from_url
&& let Ok(cred) = Cred::ssh_key_from_agent(username)
{
return Ok(cred);
}
// Fallback to key file (~/.ssh/id_rsa)
let home = dirs::home_dir()
.ok_or_else(|| git2::Error::from_str("Could not find home directory"))?;

View File

@@ -365,7 +365,7 @@ impl GitHubService {
.send()
.await
.map_err(|e| {
GitHubServiceError::Repository(format!("Failed to list repositories: {}", e))
GitHubServiceError::Repository(format!("Failed to list repositories: {e}"))
})?;
let repositories: Vec<RepositoryInfo> = repos_page