mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 09:00:18 +01:00 
			
		
		
		
	Detect and remove "Identity added:" line from the remote server.
This commit is contained in:
		
							parent
							
								
									dd79eca75f
								
							
						
					
					
						commit
						7b3114498c
					
				@ -61,6 +61,26 @@ class ReleaseTask extends AbstractTask implements IsReleaseAware, SkipOnOverride
 | 
				
			|||||||
                // and awk parameters need special care depending on the executing shell
 | 
					                // and awk parameters need special care depending on the executing shell
 | 
				
			||||||
                $resultFetch = $this->runCommandRemote("ls -ld .", $directoryInfos);
 | 
					                $resultFetch = $this->runCommandRemote("ls -ld .", $directoryInfos);
 | 
				
			||||||
                if (!empty($directoryInfos)) {
 | 
					                if (!empty($directoryInfos)) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    // break $directoryInfos by line break
 | 
				
			||||||
 | 
					                    // to exclude unwanted line(s)
 | 
				
			||||||
 | 
					                    $lines = explode("\n", $directoryInfos);
 | 
				
			||||||
 | 
					                    $filtered_lines = array();
 | 
				
			||||||
 | 
					                    foreach ($lines as $line) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        // exclude line that starts with 'Identity added'
 | 
				
			||||||
 | 
					                        // e.g.: from ssh with ProxyCommand / proxy jump
 | 
				
			||||||
 | 
					                        if (stripos($line, "Identity added") !== FALSE) {
 | 
				
			||||||
 | 
					                            continue;
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        $filtered_lines[] = $line;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    // reconstruct $directoryInfos using the filtered lines
 | 
				
			||||||
 | 
					                    $directoryInfos = implode("\n", $filtered_lines);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    //uniformize format as it depends on the system deployed on
 | 
					                    //uniformize format as it depends on the system deployed on
 | 
				
			||||||
                    $directoryInfos = trim(str_replace(array("  ", "\t"), ' ', $directoryInfos));
 | 
					                    $directoryInfos = trim(str_replace(array("  ", "\t"), ' ', $directoryInfos));
 | 
				
			||||||
                    $infoArray = explode(' ', $directoryInfos);
 | 
					                    $infoArray = explode(' ', $directoryInfos);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user