3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-04-07 05:44:07 +00:00

clean up exports

This commit is contained in:
Arpad Borsos 2020-09-28 12:14:11 +02:00
parent e0c07d2a65
commit a6b59fa340

View file

@ -14,14 +14,14 @@ export const paths = {
target: "target", target: "target",
}; };
export interface CacheConfig { interface CacheConfig {
name: string; name: string;
path: string; path: string;
key: string; key: string;
restoreKeys?: Array<string>; restoreKeys?: Array<string>;
} }
export interface Caches { interface Caches {
index: CacheConfig; index: CacheConfig;
cache: CacheConfig; cache: CacheConfig;
// git: CacheConfig; // git: CacheConfig;
@ -76,7 +76,7 @@ export async function getCaches(): Promise<Caches> {
}; };
} }
export async function getRustKey(): Promise<string> { async function getRustKey(): Promise<string> {
const rustc = await getRustVersion(); const rustc = await getRustVersion();
return `${rustc.release}-${rustc.host}-${rustc["commit-hash"]}`; return `${rustc.release}-${rustc.host}-${rustc["commit-hash"]}`;
} }
@ -87,7 +87,7 @@ interface RustVersion {
"commit-hash": string; "commit-hash": string;
} }
export async function getRustVersion(): Promise<RustVersion> { async function getRustVersion(): Promise<RustVersion> {
const stdout = await getCmdOutput("rustc", ["-vV"]); const stdout = await getCmdOutput("rustc", ["-vV"]);
let splits = stdout let splits = stdout
.split(/[\n\r]+/) .split(/[\n\r]+/)
@ -129,7 +129,7 @@ export async function getRegistryName() {
return path.basename(path.dirname(first)); return path.basename(path.dirname(first));
} }
export async function getLockfileHash() { async function getLockfileHash() {
const globber = await glob.create("**/Cargo.toml\n**/Cargo.lock", { followSymbolicLinks: false }); const globber = await glob.create("**/Cargo.toml\n**/Cargo.lock", { followSymbolicLinks: false });
const files = await globber.glob(); const files = await globber.glob();
files.sort((a, b) => a.localeCompare(b)); files.sort((a, b) => a.localeCompare(b));