Skip to content

Commit d134556

Browse files
authored
Merge pull request #32 from adobe/31-tccc-error
fixed issue when route is sitemap
2 parents 86cc55f + 6557f1d commit d134556

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tools/log-viewer/scripts.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,15 @@ class RewrittenData {
222222
return writeA(`${this.data.ref}--${this.data.repo}--${this.data.owner}.hlx.page${value}`, value);
223223
}
224224
if (type === 'sitemap') {
225-
const paths = this.data.updated.map(
226-
(update) => writeA(`${this.data.ref}--${this.data.repo}--${this.data.owner}.hlx.live${update}`, update),
227-
);
228-
return paths.join(', <br />');
225+
// when source: sitemap, we get arrays of paths
226+
if (this.data.updated) {
227+
const paths = this.data.updated.map(
228+
(update) => writeA(`${this.data.ref}--${this.data.repo}--${this.data.owner}.hlx.live${update}`, update),
229+
);
230+
return paths.join(', <br />');
231+
}
232+
// when route: sitemap, we only get a path
233+
return writeA(`${this.data.ref}--${this.data.repo}--${this.data.owner}.hlx.live${this.data.path}`, this.data.path);
229234
}
230235
if (type === 'status') {
231236
return writeA(`${ADMIN}/status/${this.data.owner}/${this.data.repo}/${this.data.ref}${value}`, value);

0 commit comments

Comments
 (0)