3 Commits
v0.0.5 ... main

Author SHA1 Message Date
b8973559ca chore(release): v0.0.7 2026-05-29 08:55:02 -04:00
f6485830b8 fix: local site url from env + cwd 2026-05-29 08:54:30 -04:00
b9a06880b4 chore(release): v0.0.6 2026-05-27 08:54:11 -04:00
3 changed files with 28 additions and 3 deletions

View File

@@ -1,5 +1,17 @@
# Changelog
## v0.0.7
[compare changes](https://gitea.websimple.com/pascalmartineau/wpop/compare/v0.0.6...v0.0.7)
### 🩹 Fixes
- Local site url from env + cwd (f648583)
## v0.0.6
[compare changes](https://gitea.websimple.com/pascalmartineau/wpop/compare/v0.0.5...v0.0.6)
## v0.0.5
[compare changes](https://gitea.websimple.com/pascalmartineau/wpop/compare/v0.0.4...v0.0.5)

View File

@@ -1,6 +1,6 @@
{
"name": "@lewebsimple/wpop",
"version": "0.0.5",
"version": "0.0.7",
"description": "WordPress operations CLI for Websimple projects.",
"license": "MIT",
"author": "Pascal Martineau <pascal@lewebsimple.ca>",

View File

@@ -1,5 +1,5 @@
import { existsSync, mkdirSync, readdirSync } from "node:fs";
import { join } from "node:path";
import { basename, join } from "node:path";
import { consola } from "consola";
import prompts from "prompts";
import type { WPopContext } from "../lib/context";
@@ -74,7 +74,7 @@ export async function sync(context: WPopContext, options: SyncOptions): Promise<
let localSiteurl: string | undefined;
if (components.has("database") && !options.skipSearchReplace) {
localSiteurl = await readLocalOption(context, "siteurl");
localSiteurl = resolveLocalSiteurl(context) ?? (await readLocalOption(context, "siteurl"));
}
for (const component of CONTENT_SYNC_COMPONENTS) {
@@ -382,6 +382,19 @@ async function runSearchReplace(
await run(context, "wp", ["cache", "flush"], { cwd: context.cwd });
}
function resolveLocalSiteurl(context: WPopContext): string | undefined {
const protocol = process.env.WEBSIMPLE_STACK_PROTOCOL?.trim();
const domain = process.env.WEBSIMPLE_STACK_DOMAIN?.trim();
if (!protocol || !domain) {
return undefined;
}
const subdomain = basename(context.cwd);
if (!subdomain) {
return undefined;
}
return `${protocol}://${subdomain}.${domain}`;
}
async function readLocalOption(context: WPopContext, option: string): Promise<string | undefined> {
const result = await run(context, "wp", ["option", "get", option], {
capture: true,