Skip to content

Commit

Permalink
sed replace compatability
Browse files Browse the repository at this point in the history
this works on linux and OSx (linux has undocumented -E option)
  • Loading branch information
Artistan authored Aug 3, 2017
1 parent 972d71c commit 88919a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Console/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private function all_sed_and_done(){
* @param $string
*/
private function sed($string){
echo shell_exec('LC_ALL=C sed -i \'s/([)\;]|^)'.$string.'/\1adminer_'.$string.'/g\' '.$this->filename);
echo shell_exec('LC_ALL=C sed -E \'s/\([)\;]|^\)'.$string.'/\1adminer_'.$string.'/g\' '.$this->filename.' > '.$this->tmpfile.' ');
echo shell_exec('rm -f '.$this->filename.'; mv '.$this->tmpfile.' '.$this->filename.'');
}
}

0 comments on commit 88919a8

Please sign in to comment.