@toptal/davinci-ci 2.0.5-alpha-SP-2807-move-naming-convention-to-overrides.17 → 2.0.5-alpha-SP-2753-add-danger-file-command-option.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-ci",
3
- "version": "2.0.5-alpha-SP-2807-move-naming-convention-to-overrides.17+e8b07018",
3
+ "version": "2.0.5-alpha-SP-2753-add-danger-file-command-option.17+4c9e919a",
4
4
  "description": "Continuos integrations tools for frontend projects",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -32,9 +32,9 @@
32
32
  "dependencies": {
33
33
  "@commitlint/cli": "^17.0.2",
34
34
  "@commitlint/config-conventional": "^17.0.2",
35
- "@toptal/davinci-cli-shared": "1.5.5-alpha-SP-2807-move-naming-convention-to-overrides.17+e8b07018",
35
+ "@toptal/davinci-cli-shared": "1.5.5-alpha-SP-2753-add-danger-file-command-option.17+4c9e919a",
36
36
  "danger": "^11.0.5",
37
37
  "markdown-table": "^2.0.0"
38
38
  },
39
- "gitHead": "e8b07018e30fc654d7f6d3f84987ab7884fc4dbd"
39
+ "gitHead": "4c9e919a813918f0137a305a4bf5ae04436fe0cd"
40
40
  }
@@ -15,12 +15,18 @@ const commandOptions = [
15
15
  label: 'checks commit message quality locally',
16
16
  name: '--local',
17
17
  },
18
+ {
19
+ label: 'specify custom danger file',
20
+ name: '--dangerfile',
21
+ },
18
22
  ]
19
23
 
20
- const dangerCommand = ({ options }) => {
24
+ const dangerCommand = args => {
25
+ const { options } = args
26
+
21
27
  print.green('Running danger check...')
22
28
 
23
- const { local, ...rest } = options
29
+ const { local, dangerfile, ...rest } = options
24
30
 
25
31
  const conventionalCommitsDangerfilePath = files.getPackageFilePath(
26
32
  '@toptal/davinci-ci',
@@ -31,9 +37,18 @@ const dangerCommand = ({ options }) => {
31
37
  'src/configs/danger/toptal/dangerfile.js'
32
38
  )
33
39
 
34
- const dangerfilePath = davinciProjectConfig.master.conventionalCommits
35
- ? conventionalCommitsDangerfilePath
36
- : toptalCommitsDangerfilePath
40
+ let dangerfilePath = dangerfile
41
+
42
+ print.green('Display args')
43
+ print.green(args)
44
+
45
+ print.green(`Display danger file dangerfilePath -- : ${dangerfilePath}`)
46
+
47
+ if (!dangerfilePath) {
48
+ dangerfilePath = davinciProjectConfig.master.conventionalCommits
49
+ ? conventionalCommitsDangerfilePath
50
+ : toptalCommitsDangerfilePath
51
+ }
37
52
 
38
53
  runSync(
39
54
  'yarn',
@@ -54,6 +69,9 @@ const dangerCommandCreator = {
54
69
  command: 'danger',
55
70
  description: 'Run danger check',
56
71
  options: commandOptions,
72
+ types: {
73
+ string: ['dangerfile'],
74
+ },
57
75
  }
58
76
 
59
77
  module.exports = dangerCommandCreator