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

nikelborm / fetch-github-folder / 14985702902

13 May 2025 12:51AM UTC coverage: 83.777% (-1.5%) from 85.29%
14985702902

push

github

nikelborm
quick save: Tue May 13 03:51:39 MSK 2025

77 of 84 branches covered (91.67%)

Branch coverage included in aggregate %.

584 of 705 relevant lines covered (82.84%)

3.93 hits per line

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

0.0
/fetch-github-folder.ts
1
#!/usr/bin/env node
2

3
import { CliConfig, Span } from '@effect/cli';
×
4
import { make, run } from '@effect/cli/Command';
×
5
import { layer as NodeFileSystemLayer } from '@effect/platform-node-shared/NodeFileSystem';
×
6
import { layer as NodePathLayer } from '@effect/platform-node-shared/NodePath';
×
7
import { runMain } from '@effect/platform-node-shared/NodeRuntime';
×
8
import { prettyPrint } from 'effect-errors';
×
9
import { layer as NodeTerminalLayer } from '@effect/platform-node-shared/NodeTerminal';
×
10
import { catchAll, fail, provide, sandbox, withSpan } from 'effect/Effect';
×
11
import { pipe } from 'effect/Function';
×
12
import pkg from './package.json' with { type: 'json' };
×
13
import {
×
14
  destinationPathCLIOptionBackedByEnv,
15
  downloadEntityFromRepo,
16
  gitRefCLIOptionBackedByEnv,
17
  OctokitLayer,
18
  pathToEntityInRepoCLIOptionBackedByEnv,
19
  repoNameCLIOptionBackedByEnv,
20
  repoOwnerCLIOptionBackedByEnv,
21
} from './src/index.ts';
22

23
const appCommand = make(
×
24
  pkg.name,
×
25
  {
×
26
    repo: {
×
27
      owner: repoOwnerCLIOptionBackedByEnv,
×
28
      name: repoNameCLIOptionBackedByEnv,
×
29
    },
×
30
    pathToEntityInRepo: pathToEntityInRepoCLIOptionBackedByEnv,
×
31
    localPathAtWhichEntityFromRepoWillBeAvailable:
×
32
      destinationPathCLIOptionBackedByEnv,
×
33
    gitRef: gitRefCLIOptionBackedByEnv,
×
34
  },
×
35
  downloadEntityFromRepo,
×
36
);
×
37

38
const cli = run(appCommand, {
×
39
  name: pkg.name,
×
40
  version: pkg.version,
×
41
  summary: Span.text(pkg.description),
×
42
});
×
43

44
pipe(
×
45
  process.argv,
×
46
  cli,
×
47
  provide(NodeFileSystemLayer),
×
48
  provide(NodePathLayer),
×
49
  provide(NodeTerminalLayer),
×
50
  provide(CliConfig.layer({ showTypes: false })),
×
51
  provide(
×
52
    OctokitLayer({
×
53
      // auth: getEnvVarOrFail('GITHUB_ACCESS_TOKEN'),
54
    }),
×
55
  ),
×
56
  sandbox,
×
57
  catchAll(e => {
×
58
    console.error(prettyPrint(e));
×
59

60
    return fail(e);
×
61
  }),
×
62
  withSpan('cli', {
×
63
    attributes: {
×
64
      name: pkg.name,
×
65
      version: pkg.version,
×
66
    },
×
67
  }),
×
68
  runMain({
×
69
    disableErrorReporting: true,
×
70
  }),
×
71
);
×
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