mirror of
				https://github.com/Swatinem/rust-cache
				synced 2025-11-04 14:39:11 +00:00 
			
		
		
		
	
							parent
							
								
									ebd95456c3
								
							
						
					
					
						commit
						31c41a926e
					
				
					 1 changed files with 12 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -86,16 +86,20 @@ export async function getCacheConfig(): Promise<CacheConfig> {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
export async function getCargoBins(): Promise<Set<string>> {
 | 
			
		||||
  const { installs }: { installs: { [key: string]: { bins: Array<string> } } } = JSON.parse(
 | 
			
		||||
    await fs.promises.readFile(path.join(paths.cargoHome, ".crates2.json"), "utf8"),
 | 
			
		||||
  );
 | 
			
		||||
  const bins = new Set<string>();
 | 
			
		||||
  for (const pkg of Object.values(installs)) {
 | 
			
		||||
    for (const bin of pkg.bins) {
 | 
			
		||||
      bins.add(bin);
 | 
			
		||||
  try {
 | 
			
		||||
    const { installs }: { installs: { [key: string]: { bins: Array<string> } } } = JSON.parse(
 | 
			
		||||
      await fs.promises.readFile(path.join(paths.cargoHome, ".crates2.json"), "utf8"),
 | 
			
		||||
    );
 | 
			
		||||
    const bins = new Set<string>();
 | 
			
		||||
    for (const pkg of Object.values(installs)) {
 | 
			
		||||
      for (const bin of pkg.bins) {
 | 
			
		||||
        bins.add(bin);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return bins;
 | 
			
		||||
  } catch {
 | 
			
		||||
    return new Set<string>();
 | 
			
		||||
  }
 | 
			
		||||
  return bins;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function getRustKey(): Promise<string> {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue