shell: rework code to use shell.spawn

spawn gives out streams and we have more control over the stdout/stderr
buffers. otherwise, we have to provide a max buffer capture size to exec
This commit is contained in:
Girish Ramakrishnan
2024-10-15 10:10:15 +02:00
parent 7b648cddfd
commit 6c3ca9c364
18 changed files with 101 additions and 88 deletions

View File

@@ -146,7 +146,7 @@ async function exportToFile(file) {
assert.strictEqual(typeof file, 'string');
// latest mysqldump enables column stats by default which is not present in 5.7 util
const mysqlDumpHelp = await shell.exec('/usr/bin/mysqldump --help', {});
const mysqlDumpHelp = await shell.spawn('/usr/bin/mysqldump', ['--help'], { encoding: 'utf8' });
const hasColStats = mysqlDumpHelp.includes('column-statistics');
const colStats = hasColStats ? '--column-statistics=0' : '';