From da1ab05e31bc6c63e5cfba6b04f1b73795a36688 Mon Sep 17 00:00:00 2001 From: Vilius Sutkus '89 Date: Wed, 3 Mar 2021 00:43:22 +0200 Subject: [PATCH] Comments about mkdir/rmdir --- src/main.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 400a5dd..95bd9ba 100644 --- a/src/main.ts +++ b/src/main.ts @@ -117,12 +117,14 @@ async function installSdkManager(): Promise { CMDLINE_TOOLS_VERSION ) + // Create parent directory fs.mkdirSync(path.dirname(desiredLocation), {recursive: true}) - // @TODO: use io.mv instead of fs-extra once following issue is resolved: - // https://github.com/actions/toolkit/issues/706 + // Make sure we don't have leftover target directory (happens sometimes...) if (fs.existsSync(desiredLocation)) fse.removeSync(desiredLocation) + // @TODO: use io.mv instead of fs-extra.moveSync once following issue is resolved: + // https://github.com/actions/toolkit/issues/706 fse.moveSync( path.join(cmdlineToolsExtractedLocation, 'cmdline-tools'), desiredLocation