-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprData.js
38 lines (34 loc) · 1.01 KB
/
prData.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import chalk from 'chalk';
import { existsSync } from 'fs';
import { join } from 'path';
export default {
prDetails: {
'branchName': 'feature/branch',
'title': 'Feature/branch - Fix bugs',
'description': 'Fixes the bugs',
'commitMessage': 'fix: the bugs',
},
'targetFile': 'package.json',
'find': 'needle',
'replace': 'better needle',
predicate(dir) {
const makePath = (subdir) => join(dir, subdir);
const subdirExists = (subdir) => existsSync(makePath(subdir));
const cypressExists = subdirExists('cypress');
const srcExists = subdirExists('src');
const shouldContinue = cypressExists && !srcExists;
if (!shouldContinue) {
console.log(chalk.yellow(`Predicate was not satisfied for ${dir}:`));
console.dir({
cypressExists,
srcExists
});
}
return shouldContinue;
},
'repos': {
'test': [
'foobar'
]
}
};