Skip to content

Commit 3afd257

Browse files
committed
Fix indexes in snapshot
1 parent bd6c097 commit 3afd257

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

nx/blocks/snapshot-admin/utils/utils.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,12 @@ export async function copyManifest(name, resources, direction) {
144144
try {
145145
const url = new URL(res.aemPreview);
146146

147-
const ext = url.pathname.endsWith('.json') ? '' : '.html';
147+
const path = url.pathname.endsWith('/') ? `${url.pathname}index` : url.pathname;
148148

149-
const main = `/${org}/${site}${res.path}${ext}`;
150-
const fork = `/${org}/${site}/.snapshots/${name}${res.path}${ext}`;
149+
const extPath = path.endsWith('.json') ? path : `${path}.html`;
150+
151+
const main = `/${org}/${site}${extPath}`;
152+
const fork = `/${org}/${site}/.snapshots/${name}${extPath}`;
151153

152154
url.source = direction === 'fork' ? main : fork;
153155
url.destination = direction === 'fork' ? fork : main;

0 commit comments

Comments
 (0)