fix: create rust cache dirs asynchronously

This commit is contained in:
Taku Kodma 2026-05-10 20:29:23 +10:00
parent a09f8173fa
commit 17411053db
No known key found for this signature in database
GPG key ID: 2FA149ECEAB1E16D
3 changed files with 9 additions and 9 deletions

8
dist/index.js generated vendored
View file

@ -88921,7 +88921,7 @@ async function run() {
try {
await setToolVersions();
await setMiseToml();
setupRustCache();
await setupRustCache();
let cacheKey;
if (getBooleanInput('cache')) {
cacheKey = await restoreMiseCache();
@ -89025,7 +89025,7 @@ function setupWings() {
* workflows that use rust-cache, rustup, setup-rust-toolchain, or another
* Rust setup action outside of mise.
*/
function setupRustCache() {
async function setupRustCache() {
if (!getBooleanInput('cache_rust')) {
return;
}
@ -89046,8 +89046,8 @@ function setupRustCache() {
else {
exportVariable('MISE_CARGO_HOME', cargoHome);
}
fs.mkdirSync(rustupHome, { recursive: true });
fs.mkdirSync(cargoHome, { recursive: true });
await fs.promises.mkdir(rustupHome, { recursive: true });
await fs.promises.mkdir(cargoHome, { recursive: true });
info('mise rust cache: enabled. mise-managed rustup and cargo homes will be restored and saved with the mise cache.');
}
async function exportMiseEnv() {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -46,7 +46,7 @@ async function run(): Promise<void> {
try {
await setToolVersions()
await setMiseToml()
setupRustCache()
await setupRustCache()
let cacheKey: string | undefined
if (core.getBooleanInput('cache')) {
@ -156,7 +156,7 @@ function setupWings(): void {
* workflows that use rust-cache, rustup, setup-rust-toolchain, or another
* Rust setup action outside of mise.
*/
function setupRustCache(): void {
async function setupRustCache(): Promise<void> {
if (!core.getBooleanInput('cache_rust')) {
return
}
@ -182,8 +182,8 @@ function setupRustCache(): void {
core.exportVariable('MISE_CARGO_HOME', cargoHome)
}
fs.mkdirSync(rustupHome, { recursive: true })
fs.mkdirSync(cargoHome, { recursive: true })
await fs.promises.mkdir(rustupHome, { recursive: true })
await fs.promises.mkdir(cargoHome, { recursive: true })
core.info(
'mise rust cache: enabled. mise-managed rustup and cargo homes will be restored and saved with the mise cache.'