22
33import { replace } from '@automattic/vip-search-replace' ;
44import chalk from 'chalk' ;
5+ import debugLib from 'debug' ;
56import fs from 'fs' ;
67import Lando from 'lando' ;
78import { pipeline } from 'node:stream/promises' ;
@@ -17,6 +18,8 @@ import { fixMyDumperTransform, getSqlDumpDetails, SqlDumpType } from '../lib/dat
1718import { makeTempDir } from '../lib/utils' ;
1819import { getReadInterface } from '../lib/validations/line-by-line' ;
1920
21+ const debug = debugLib ( '@automattic/vip:bin:dev-environment' ) ;
22+
2023/**
2124 * Replaces the domain in the given URL
2225 *
@@ -203,6 +206,12 @@ export class DevEnvSyncSQLCommand {
203206
204207 const primaryUrl = networkSites . find ( site => site ?. blogId === 1 ) ?. homeUrl ;
205208 const primaryDomain = primaryUrl ? new URL ( primaryUrl ) . hostname : '' ;
209+ debug (
210+ 'Network sites: %j, primary URL: %s, primary domain: %s' ,
211+ networkSites ,
212+ primaryUrl ,
213+ primaryDomain
214+ ) ;
206215
207216 for ( const site of networkSites ) {
208217 if ( ! site ?. blogId || site . blogId === 1 ) continue ;
@@ -343,6 +352,7 @@ DROP PROCEDURE vip_sync_update_blog_domains;
343352 try {
344353 console . log ( 'Extracting site urls from the SQL file...' ) ;
345354 this . siteUrls = await extractSiteUrls ( this . sqlFile ) ;
355+ debug ( 'Extracted site URLs: %j' , this . siteUrls ) ;
346356 } catch ( err ) {
347357 const error = err as Error ;
348358 await this . track ( 'error' , {
0 commit comments