@@ -13,6 +13,8 @@ class FrontendCommand extends BltTasks {
13
13
* Runs all frontend targets.
14
14
*
15
15
* @command frontend
16
+ *
17
+ * @executeInDrupalVm
16
18
*/
17
19
public function frontend () {
18
20
$ status_code = $ this ->invokeCommands ([
@@ -23,44 +25,25 @@ public function frontend() {
23
25
return $ status_code ;
24
26
}
25
27
26
- /**
27
- * Indicates whether a frontend hook should be invoked inside of Drupal VM.
28
- *
29
- * @return bool
30
- * TRUE if it should be invoked inside of Drupal VM.
31
- */
32
- protected function shouldExecuteInDrupalVm () {
33
- return $ this ->getInspector ()->isDrupalVmLocallyInitialized ()
34
- && $ this ->getInspector ()->isDrupalVmBooted ()
35
- && !$ this ->getInspector ()->isVmCli ();
36
- }
37
-
38
28
/**
39
29
* Invokes a frontend hook.
40
30
*
41
- * The hook will be invoked in Drupal VM if is initialized and booted.
42
- * Otherwise, it will be invoked on the host machine.
43
- *
44
31
* @param string $hook
45
32
* The hook to invoke. E.g., "build" would invoke "frontend-build" hook.
46
33
*
47
34
* @return int|\Robo\Result
48
35
* The status code or result object.
49
36
*/
50
37
protected function invokeFrontendHook ($ hook ) {
51
- if ($ this ->shouldExecuteInDrupalVm ()) {
52
- $ this ->say ("Executing $ hook target hook inside of Drupal VM... " );
53
- return $ this ->executeCommandInDrupalVm ("blt frontend: $ hook " );
54
- }
55
- else {
56
- return $ this ->invokeHook ("frontend- $ hook " );
57
- }
38
+ return $ this ->invokeHook ("frontend- $ hook " );
58
39
}
59
40
60
41
/**
61
42
* Executes frontend-build target hook.
62
43
*
63
44
* @command frontend:build
45
+ *
46
+ * @executeInDrupalVm
64
47
*/
65
48
public function build () {
66
49
return $ this ->invokeFrontendHook ('build ' );
@@ -70,6 +53,8 @@ public function build() {
70
53
* Executes frontend-setup target hook.
71
54
*
72
55
* @command frontend:setup
56
+ *
57
+ * @executeInDrupalVm
73
58
*/
74
59
public function setup () {
75
60
return $ this ->invokeFrontendHook ('setup ' );
@@ -79,6 +64,8 @@ public function setup() {
79
64
* Executes frontend-test target hook.
80
65
*
81
66
* @command frontend:test
67
+ *
68
+ * @executeInDrupalVm
82
69
*/
83
70
public function test () {
84
71
return $ this ->invokeFrontendHook ('test ' );
0 commit comments