mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-04-30 13:50:02 +00:00
Add new input.
This commit is contained in:
parent
e6a829b5bd
commit
6a8624d80a
5 changed files with 23 additions and 8 deletions
|
@ -18,12 +18,19 @@ export function getCacheTarget(): string {
|
|||
return core.getInput('cache-target') || 'debug';
|
||||
}
|
||||
|
||||
export function getTargetPaths(): string[] {
|
||||
const profile = getCacheTarget();
|
||||
const dirs = core.getInput('target-dirs', { required: true }).split(',');
|
||||
|
||||
return dirs.filter((dir) => dir.trim()).map((dir) => path.join(WORKSPACE_ROOT, dir, profile));
|
||||
}
|
||||
|
||||
export function getCachePaths(): string[] {
|
||||
return [
|
||||
// ~/.cargo/registry
|
||||
path.join(CARGO_HOME, 'registry'),
|
||||
// /workspace/target/debug
|
||||
path.join(WORKSPACE_ROOT, 'target', getCacheTarget()),
|
||||
...getTargetPaths(),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue