mirror of
https://github.com/moonrepo/setup-rust.git
synced 2025-06-07 14:46:37 +00:00
fix: Dont error on missing index dir.
This commit is contained in:
parent
aaa9e56585
commit
8e43d3720d
2 changed files with 12 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@moonrepo/setup-rust",
|
"name": "@moonrepo/setup-rust",
|
||||||
"version": "0.3.5",
|
"version": "0.3.6",
|
||||||
"description": "A GitHub action for setting up Rust and Cargo.",
|
"description": "A GitHub action for setting up Rust and Cargo.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -132,6 +132,7 @@ export async function cleanCargoRegistry() {
|
||||||
// .cargo/registry/index - Delete .cache directories
|
// .cargo/registry/index - Delete .cache directories
|
||||||
const indexDir = path.join(registryDir, 'index');
|
const indexDir = path.join(registryDir, 'index');
|
||||||
|
|
||||||
|
if (fs.existsSync(indexDir)) {
|
||||||
for (const index of fs.readdirSync(indexDir)) {
|
for (const index of fs.readdirSync(indexDir)) {
|
||||||
if (fs.existsSync(path.join(indexDir, index, '.git'))) {
|
if (fs.existsSync(path.join(indexDir, index, '.git'))) {
|
||||||
const dir = path.join(indexDir, index, '.cache');
|
const dir = path.join(indexDir, index, '.cache');
|
||||||
|
@ -146,6 +147,7 @@ export async function cleanCargoRegistry() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// .cargo/registry/cache - Do nothing?
|
// .cargo/registry/cache - Do nothing?
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue