@@ -73,14 +73,14 @@ protected function execute(InputInterface $input, OutputInterface $output) {
7373 $ this ->io ->comment (sprintf ('Checking out %s (%s) on %s ' ,
7474 $ this ->siteName ,
7575 $ this ->ref ,
76- $ this ->repo [ ' directory ' ]
76+ $ this ->root
7777 ));
7878
7979 switch ($ this ->repo ['type ' ]) {
8080 case 'git ' :
8181 // Check if repo exists and has any changes.
82- if ($ this ->fileExists ($ this ->repo [ ' directory ' ] ) &&
83- $ this ->fileExists ($ this ->repo [ ' directory ' ] . '. ' . $ this ->repo ['type ' ])
82+ if ($ this ->fileExists ($ this ->root ) &&
83+ $ this ->fileExists ($ this ->root . '. ' . $ this ->repo ['type ' ])
8484 ) {
8585 if ($ input ->hasOption ('force ' ) &&
8686 !$ input ->getOption ('force ' )
@@ -111,13 +111,10 @@ protected function execute(InputInterface $input, OutputInterface $output) {
111111 * @throws CommandException
112112 *
113113 * @return string Repo url
114- *
115- * @todo validate for all command that use repo config.
116114 */
117115 protected function validateRepo () {
118116 if (isset ($ this ->config ['repo ' ])) {
119117 $ this ->repo = $ this ->config ['repo ' ];
120- $ this ->repo ['directory ' ] = rtrim ($ this ->repo ['directory ' ], '/ ' ) . '/ ' ;
121118 }
122119 else {
123120 throw new CommandException ('Repo not found in sites.yml ' );
@@ -136,7 +133,7 @@ protected function validateRepo() {
136133 protected function gitDiff () {
137134 $ command = sprintf (
138135 'cd %s && git diff-files --name-status -r --ignore-submodules ' ,
139- $ this ->shellPath ($ this ->repo [ ' directory ' ] )
136+ $ this ->shellPath ($ this ->root )
140137 );
141138
142139 $ shellProcess = $ this ->getShellProcess ();
@@ -146,7 +143,7 @@ protected function gitDiff() {
146143 $ message = sprintf ('You have uncommitted changes on %s ' . PHP_EOL .
147144 'Please commit or revert your changes before checking out the site. ' . PHP_EOL .
148145 'If you want to wipe your local changes use --force. ' ,
149- $ this ->repo [ ' directory ' ]
146+ $ this ->root
150147 );
151148 throw new CommandException ($ message );
152149 }
@@ -168,14 +165,14 @@ protected function gitDiff() {
168165 protected function gitClone () {
169166 $ command = sprintf ('git clone %s %s ' ,
170167 $ this ->repo ['url ' ],
171- $ this ->shellPath ($ this ->repo [ ' directory ' ] )
168+ $ this ->shellPath ($ this ->root )
172169 );
173170 $ this ->io ->commentBlock ($ command );
174171
175172 $ shellProcess = $ this ->getShellProcess ();
176173
177174 if ($ shellProcess ->exec ($ command , TRUE )) {
178- $ this ->io ->success (sprintf ('Repo cloned on %s ' , $ this ->repo [ ' directory ' ] ));
175+ $ this ->io ->success (sprintf ('Repo cloned on %s ' , $ this ->root ));
179176 }
180177 else {
181178 throw new CommandException ($ shellProcess ->getOutput ());
@@ -196,10 +193,10 @@ protected function gitClone() {
196193 */
197194 protected function gitCheckout () {
198195 $ commands = [
199- sprintf ('cd %s ' , $ this ->shellPath ($ this ->repo [ ' directory ' ] )),
196+ sprintf ('cd %s ' , $ this ->shellPath ($ this ->root )),
200197 'git fetch --all ' ,
201- sprintf ('chmod 777 %s/sites/ default ' , $ this ->drupal_directory ),
202- sprintf ('chmod 777 %s/sites/ default/settings.php ' , $ this ->drupal_directory ),
198+ sprintf ('chmod 777 %ssites/ default ' , $ this ->web_root ),
199+ sprintf ('chmod 777 %ssites/ default/settings.php ' , $ this ->web_root ),
203200 sprintf ('git checkout %s --force ' , $ this ->ref ),
204201 ];
205202 $ command = implode (' && ' , $ commands );
@@ -223,10 +220,10 @@ protected function gitCheckout() {
223220 * @return mixed
224221 */
225222 protected function getCurrentRef () {
226- if ($ this ->fileExists ($ this ->repo [ ' directory ' ] )) {
223+ if ($ this ->fileExists ($ this ->root )) {
227224 // Get branch from site directory.
228225 $ command = sprintf ('cd %s && git branch ' ,
229- $ this ->shellPath ($ this ->repo [ ' directory ' ] )
226+ $ this ->shellPath ($ this ->root )
230227 );
231228
232229 $ shellProcess = $ this ->getShellProcess ()->printOutput (FALSE );
0 commit comments