create-confluence-sync 1.0.3 → 1.0.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/sync.js +8 -1
package/package.json
CHANGED
package/src/sync.js
CHANGED
|
@@ -165,7 +165,14 @@ export async function push(apiClient, tree, projectRoot, spaceKey, changedFiles)
|
|
|
165
165
|
let created = 0;
|
|
166
166
|
let updated = 0;
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
// Sort by path depth — create parents before children
|
|
169
|
+
const sorted = [...changedFiles].sort((a, b) => {
|
|
170
|
+
const depthA = a.replace(/\\/g, '/').split('/').length;
|
|
171
|
+
const depthB = b.replace(/\\/g, '/').split('/').length;
|
|
172
|
+
return depthA - depthB;
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
for (let filePath of sorted) {
|
|
169
176
|
let normalized = filePath.replace(/\\/g, '/');
|
|
170
177
|
let absolutePath = path.resolve(projectRoot, normalized);
|
|
171
178
|
|