@atomicsmash/cli 9.0.0-beta.11 → 9.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"pull-database.d.ts","sourceRoot":"","sources":["../../src/commands/pull-database.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,OAAO,kBAAkB,CAAC;AACvC,eAAO,MAAM,QAAQ,oEAC6C,CAAC;AACnE,wBAAsB,OAAO,kBA6J5B"}
1
+ {"version":3,"file":"pull-database.d.ts","sourceRoot":"","sources":["../../src/commands/pull-database.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,OAAO,kBAAkB,CAAC;AACvC,eAAO,MAAM,QAAQ,oEAC6C,CAAC;AACnE,wBAAsB,OAAO,kBA8J5B"}
@@ -14,6 +14,7 @@ export async function handler() {
14
14
  const stagingSSHHost = process.env.STAGING_SSH_HOST;
15
15
  const stagingSSHPort = process.env.STAGING_SSH_PORT;
16
16
  const stagingDBPrefix = process.env.STAGING_DB_PREFIX ?? "wp_";
17
+ const stagingWebRoot = process.env.STAGING_WEB_ROOT ?? "public/current";
17
18
  const stagingUrl = process.env.STAGING_URL?.endsWith("/")
18
19
  ? process.env.STAGING_URL.slice(0, -1)
19
20
  : process.env.STAGING_URL;
@@ -76,7 +77,7 @@ export async function handler() {
76
77
  "pmxi_posts",
77
78
  "pmxi_templates",
78
79
  ].map((tableName) => stagingDBPrefix + tableName);
79
- await execute(`ssh -o "StrictHostKeyChecking no" ${stagingSSHUsername}@${stagingSSHHost} -p ${stagingSSHPort} "cd public/current && wp db export - --add-drop-table --exclude_tables=${tablesToExclude.join(",")}" > ${tmpFile}`)
80
+ await execute(`ssh -o "StrictHostKeyChecking no" ${stagingSSHUsername}@${stagingSSHHost} -p ${stagingSSHPort} "${stagingWebRoot !== "" ? `cd ${stagingWebRoot} && ` : ""}wp db export - --add-drop-table --exclude_tables=${tablesToExclude.join(",")}" > ${tmpFile}`)
80
81
  .then(async () => {
81
82
  await stopRunningMessage();
82
83
  console.log("Database downloaded.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomicsmash/cli",
3
- "version": "9.0.0-beta.11",
3
+ "version": "9.0.0-beta.12",
4
4
  "description": "A collection of CLI tools by Atomic Smash.",
5
5
  "keywords": [],
6
6
  "homepage": "https://www.atomicsmash.co.uk/",