@dboio/cli 0.9.2 → 0.9.4
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.
- package/package.json +1 -1
- package/src/commands/push.js +16 -6
package/package.json
CHANGED
package/src/commands/push.js
CHANGED
|
@@ -15,7 +15,7 @@ import { stripUidFromFilename, renameToUidConvention, hasUidInFilename } from '.
|
|
|
15
15
|
import { findMetadataFiles } from '../lib/diff.js';
|
|
16
16
|
import { loadIgnore } from '../lib/ignore.js';
|
|
17
17
|
import { detectChangedColumns, findBaselineEntry } from '../lib/delta.js';
|
|
18
|
-
import { BINS_DIR } from '../lib/structure.js';
|
|
18
|
+
import { BINS_DIR, ENTITY_DIR_NAMES } from '../lib/structure.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Resolve an @reference file path to an absolute filesystem path.
|
|
@@ -450,9 +450,10 @@ async function pushFromMetadata(meta, metaPath, client, options, changedColumns
|
|
|
450
450
|
throw new Error(`No _entity found in ${metaPath}`);
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
// Detect path mismatch
|
|
453
|
+
// Detect path mismatch (only for content, media, output, bin entities —
|
|
454
|
+
// entity-dir types use structural directories unrelated to server Path)
|
|
454
455
|
if (meta.Path) {
|
|
455
|
-
await checkPathMismatch(meta, metaPath, options);
|
|
456
|
+
await checkPathMismatch(meta, metaPath, entity, options);
|
|
456
457
|
}
|
|
457
458
|
|
|
458
459
|
const dataExprs = [];
|
|
@@ -721,7 +722,12 @@ function normalizePathForComparison(localPath) {
|
|
|
721
722
|
/**
|
|
722
723
|
* Detect if a file has been moved to a different directory than its metadata Path suggests
|
|
723
724
|
*/
|
|
724
|
-
async function checkPathMismatch(meta, metaPath, options) {
|
|
725
|
+
async function checkPathMismatch(meta, metaPath, entity, options) {
|
|
726
|
+
// Skip entity-dir types (extension, site, group, etc.) — their local
|
|
727
|
+
// directory placement is structural and unrelated to the server Path column.
|
|
728
|
+
// Only compare paths for content, media, output, and bin-placed entities.
|
|
729
|
+
if (ENTITY_DIR_NAMES.has(entity)) return;
|
|
730
|
+
|
|
725
731
|
const metaDir = dirname(metaPath);
|
|
726
732
|
const metaBase = basename(metaPath, '.metadata.json');
|
|
727
733
|
|
|
@@ -738,8 +744,12 @@ async function checkPathMismatch(meta, metaPath, options) {
|
|
|
738
744
|
|
|
739
745
|
if (!contentFileName) return;
|
|
740
746
|
|
|
741
|
-
// Compute the current path based on where the file actually is
|
|
742
|
-
|
|
747
|
+
// Compute the current path based on where the file actually is.
|
|
748
|
+
// Strip the ~UID from the filename — the metadata Path is the canonical
|
|
749
|
+
// server path and never contains the local ~UID suffix.
|
|
750
|
+
const uid = meta.UID;
|
|
751
|
+
const serverFileName = uid ? stripUidFromFilename(contentFileName, uid) : contentFileName;
|
|
752
|
+
const currentFilePath = join(metaDir, serverFileName);
|
|
743
753
|
const currentRelPath = relative(process.cwd(), currentFilePath);
|
|
744
754
|
|
|
745
755
|
// Normalize both paths for comparison
|