From 278db3c1cb4ec18e9fb12f434a5588f24645b419 Mon Sep 17 00:00:00 2001 From: Bertrand Debrie Date: Fri, 23 Nov 2018 14:00:11 +0100 Subject: [PATCH] [clone db] go to project directory before using wp-cli to replace strings --- src/clone/db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clone/db.js b/src/clone/db.js index d5c2ee9..16def4b 100644 --- a/src/clone/db.js +++ b/src/clone/db.js @@ -121,7 +121,7 @@ export function run (answers) { searchStrings.forEach(function (searchString, i) { const replaceString = replaceStrings[i] const destinationReplaceCmd = `php ${path.join(answers.basePathRemote, tmpDir, 'bin', path.basename(wpCliPath))} search-replace '${searchString}' '${replaceString}' --all-tables` - cmds.push(`ssh ${answers.sshPortRemote ? `-p ${answers.sshPortRemote}` : ''} -t ${destinationSshId} '${destinationReplaceCmd}'`) + cmds.push(`ssh ${answers.sshPortRemote ? `-p ${answers.sshPortRemote}` : ''} -t ${destinationSshId} 'cd ${answers.basePathRemote}; ${destinationReplaceCmd}'`); }) } else { searchStrings.forEach(function (searchString, i) {