mirror of https://github.com/MISP/MISP
fix: working directory in update function
fixes a path problem mentioned in issue #3528pull/4147/head
parent
e880b6a458
commit
917e8d245c
|
@ -4315,17 +4315,18 @@ class Server extends AppModel
|
|||
public function update($status)
|
||||
{
|
||||
$final = '';
|
||||
$workingDirectoryPrefix = 'cd $(git rev-parse --show-toplevel) && ';
|
||||
$cleanup_commands = array(
|
||||
// (>^-^)> [hacky]
|
||||
'git checkout app/composer.json 2>&1'
|
||||
$workingDirectoryPrefix . 'git checkout app/composer.json 2>&1'
|
||||
);
|
||||
foreach ($cleanup_commands as $cleanup_command) {
|
||||
$final .= $cleanup_command . "\n\n";
|
||||
exec($cleanup_command, $output);
|
||||
$final .= implode("\n", $output) . "\n\n";
|
||||
}
|
||||
$command1 = 'git pull origin ' . $status['branch'] . ' 2>&1';
|
||||
$command2 = 'git submodule update --init --recursive 2>&1';
|
||||
$command1 = $workingDirectoryPrefix . 'git pull origin ' . $status['branch'] . ' 2>&1';
|
||||
$command2 = $workingDirectoryPrefix . 'git submodule update --init --recursive 2>&1';
|
||||
$final .= $command1 . "\n\n";
|
||||
exec($command1, $output);
|
||||
$final .= implode("\n", $output) . "\n\n=================================\n\n";
|
||||
|
|
Loading…
Reference in New Issue