travis-ci-com
362 of 592 branches covered (61.15%)
Branch coverage included in aggregate %.
1350 of 1579 relevant lines covered (85.5%)
39.22 hits per line
1 |
import * as fs from 'fs'; |
8✔ |
2 |
import {Fixture} from '../Fixture'; |
8✔ |
3 |
import {Git} from '../Git'; |
8✔ |
4 |
import {Log} from '../Log'; |
8✔ |
5 | ||
6 |
const enum Conf { |
|
7 |
FILE = '.releaserc.yml' |
|
8 |
} |
|
9 | ||
10 |
export function handle(): void { |
50✔ |
11 |
const hasReleaseRc: boolean = (() => {
|
56✔ |
12 |
const rds = fs.readdirSync(process.cwd(), 'utf8'); |
56✔ |
13 | ||
14 |
for (const f of rds) { |
|
15 |
if (f.startsWith('.releaserc')) { |
|
16 |
return true; |
50✔ |
17 |
} |
248✔ |
18 |
} |
× |
19 | ||
20 |
return false; |
|
21 |
})(); |
50✔ |
22 | ||
23 |
if (hasReleaseRc) {
|
|
24 |
Log.info('Skipping .releaserc'); |
|
25 | ||
26 |
return;
|
× |
27 |
} |
|
28 | ||
29 |
new Fixture('init').copy(Conf.FILE, Conf.FILE); |
|
30 |
Git.add(Conf.FILE); |
50✔ |
31 | ||
32 |
Log.success('Generated .releaserc'); |
50✔ |
33 |
} |