1
0
Fork 0
chezmoi/bin/executable_jopdb
2022-12-27 11:17:19 +01:00

24 lines
411 B
Bash

#!/bin/bash
:<<'PHP'
<?php
$root = trim(shell_exec('git rev-parse --show-toplevel'));
require $root.'/www/app/config/database.cfg.d/connections.cfg.d/basic.cfg.php';
echo implode(' ', [
'-h', $config['host'],
'-u', $config['user'],
'-p'.$config['password'],
$config['db'],
]);
__halt_compiler();
PHP
read -ra cmd < <(php "$0" |tail -n1)
run="${1:-mysql}"
shift
exec $run "${cmd[@]}" "$@"