• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nikelborm / fetch-github-folder / 12804827031

16 Jan 2025 08:22AM UTC coverage: 55.394% (-1.2%) from 56.577%
12804827031

push

github

nikelborm
quick save: Thu Jan 16 11:22:57 MSK 2025

51 of 64 branches covered (79.69%)

Branch coverage included in aggregate %.

178 of 408 new or added lines in 15 files covered. (43.63%)

5 existing lines in 1 file now uncovered.

329 of 622 relevant lines covered (52.89%)

2.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/unpackRepoFolderTarGzStreamToFs.ts
NEW
1
import { Effect, all, tryMapPromise } from 'effect/Effect';
×
2
import { pipe } from 'effect/Function';
3
import { pipeline } from 'node:stream/promises';
4
import { createGunzip } from 'node:zlib';
5
import { extract } from 'tar-fs';
6
import { Readable } from 'node:stream';
7
import { OutputConfigTag } from './config.js';
8

9
export const unpackRepoFolderTarGzStreamToFs = <E, R>(
×
NEW
10
  self: Effect<Readable, E, R>,
×
11
) =>
NEW
12
  pipe(
×
NEW
13
    all([self, OutputConfigTag]),
×
NEW
14
    tryMapPromise({
×
NEW
15
      try: (
×
NEW
16
        [
×
NEW
17
          tarGzStream,
×
NEW
18
          {
×
NEW
19
            localPathAtWhichEntityFromRepoWillBeAvailable:
×
NEW
20
              pathToLocalDirWhichWillHaveContentsOfRepoDir,
×
NEW
21
          },
×
NEW
22
        ],
×
NEW
23
        signal,
×
24
      ) =>
NEW
25
        pipeline(
×
NEW
26
          tarGzStream,
×
NEW
27
          createGunzip(),
×
NEW
28
          extract(pathToLocalDirWhichWillHaveContentsOfRepoDir, {
×
NEW
29
            map: header => {
×
30
              // GitHub creates archive with nested dir inside which has all
31
              // the files we need, so we remove this dir's name from the
32
              // beginning
NEW
33
              header.name = header.name.replace(/^[^/]*\/(.*)/, '$1');
×
NEW
34
              return header;
×
NEW
35
            },
×
NEW
36
          }),
×
NEW
37
          { signal },
×
NEW
38
        ),
×
NEW
39
      catch: error =>
×
NEW
40
        new Error(
×
NEW
41
          'Failed to extract received from GitHub .tar.gz archive',
×
NEW
42
          { cause: error },
×
NEW
43
        ),
×
NEW
44
    }),
×
NEW
45
  );
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc