@@ -16,7 +16,8 @@ class DuskCommand extends BaseDuskCommand
1616 protected $ signature = 'dusk
1717 {--without-tty : Disable output to TTY}
1818 {--without-percy : Disable percy snapshots}
19- {--percy-target-branch : Set the base branch for comparison} ' ;
19+ {--percy-target-branch : Set the base branch for comparison}
20+ {--percy-target-commit : Set the base commit SHA for comparison} ' ;
2021
2122 /**
2223 * Execute the console command.
@@ -70,7 +71,8 @@ protected function env()
7071 {
7172 return array_filter ([
7273 'PERCY_TOKEN ' => env ('PERCY_TOKEN ' ),
73- 'PERCY_TARGET_BRANCH ' => $ this ->baseBranch ()
74+ 'PERCY_TARGET_BRANCH ' => $ this ->baseBranch (),
75+ 'PERCY_TARGET_COMMIT ' => $ this ->targetCommit ()
7476 ]);
7577 }
7678
@@ -84,6 +86,13 @@ protected function baseBranch()
8486 : env ('PERCY_TARGET_BRANCH ' );
8587 }
8688
89+ protected function targetCommit ()
90+ {
91+ return $ this ->hasOption ('percy-target-commit ' )
92+ ? $ this ->option ('percy-target-commit ' )
93+ : env ('PERCY_TARGET_COMMIT ' );
94+ }
95+
8796 /**
8897 * @return Process
8998 */
@@ -101,7 +110,7 @@ protected function processOptions()
101110 {
102111 return array_diff (
103112 array_slice ($ _SERVER ['argv ' ], 2 ),
104- ['--without-tty ' , '--without-percy ' , '--percy-target-branch ' ]
113+ ['--without-tty ' , '--without-percy ' , '--percy-target-branch ' , ' --percy-target-commit ' ]
105114 );
106115 }
107116}
0 commit comments