Преглед на файлове

Check platform for extension (#1732)

Cory Miller преди 1 година
родител
ревизия
24ed1a3528
променени са 2 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 3 1
      dist/index.js
  2. 3 1
      src/github-api-helper.ts

+ 3 - 1
dist/index.js

@@ -1574,7 +1574,9 @@ function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath,
         // Write archive to disk
         core.info('Writing archive to disk');
         const uniqueId = (0, uuid_1.v4)();
-        const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
+        const archivePath = IS_WINDOWS
+            ? path.join(repositoryPath, `${uniqueId}.zip`)
+            : path.join(repositoryPath, `${uniqueId}.tar.gz`);
         yield fs.promises.writeFile(archivePath, archiveData);
         archiveData = Buffer.from(''); // Free memory
         // Extract archive

+ 3 - 1
src/github-api-helper.ts

@@ -35,7 +35,9 @@ export async function downloadRepository(
   // Write archive to disk
   core.info('Writing archive to disk')
   const uniqueId = uuid()
-  const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`)
+  const archivePath = IS_WINDOWS
+    ? path.join(repositoryPath, `${uniqueId}.zip`)
+    : path.join(repositoryPath, `${uniqueId}.tar.gz`)
   await fs.promises.writeFile(archivePath, archiveData)
   archiveData = Buffer.from('') // Free memory