Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tools/site-creator/site-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ class SiteCreator extends LitElement {
const value = input.value.toLowerCase();
input.value = value; // Update the input field with lowercase value

const url = new URL(value);
const org = url.pathname.split('/')[1];
const repo = url.pathname.split('/')[2];
try {
const url = new URL(value);
const org = url.pathname.split('/')[1];
const repo = url.pathname.split('/')[2];

if (org && repo && url.hostname === 'github.com') {
this._status = null;
this._data = { org, repo };
if (org && repo && url.hostname === 'github.com') {
this._status = null;
this._data = { org, repo };
}
} catch (error) {
// Do not error when user is typing the url - validation happens on submit.
}
}

Expand Down