@erclx/canon 4.65.0 → 4.67.0

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.
@@ -2,6 +2,7 @@ import { existsSync, readFileSync } from 'node:fs'
2
2
  import { rm } from 'node:fs/promises'
3
3
  import { isAbsolute, relative, resolve } from 'node:path'
4
4
  import { copyPreservingMode } from '@/copy'
5
+ import { checkoutMismatchWarning } from '@/project-root'
5
6
  import { findInstalledOrigin, readHistoryIndex } from '@/sync/history'
6
7
  import {
7
8
  type DomainHashes,
@@ -339,6 +340,9 @@ export async function runDomainSync(
339
340
  ): Promise<number> {
340
341
  intro(adapter.banner)
341
342
 
343
+ const mismatch = checkoutMismatchWarning(process.cwd())
344
+ if (mismatch !== undefined) logWarn(mismatch)
345
+
342
346
  const resolved = resolve(target)
343
347
 
344
348
  if (!isDirectory(resolved)) {
package/src/target.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { statSync } from 'node:fs'
2
2
  import { resolve } from 'node:path'
3
- import { logError, outro } from '@/ui'
3
+ import { checkoutMismatchWarning } from '@/project-root'
4
+ import { logError, logWarn, outro } from '@/ui'
4
5
 
5
6
  export function isDirectory(path: string): boolean {
6
7
  try {
@@ -23,6 +24,9 @@ export function resolveTarget(
23
24
  target: string,
24
25
  protectedRoot: string,
25
26
  ): string | number {
27
+ const mismatch = checkoutMismatchWarning(process.cwd())
28
+ if (mismatch !== undefined) logWarn(mismatch)
29
+
26
30
  const resolved = resolve(target)
27
31
 
28
32
  if (!isDirectory(resolved)) {