Skip to content

Commit

Permalink
fix(Import): fix importing for github dir name with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemhosny committed Apr 1, 2024
1 parent fe39fd6 commit 620898b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/livecodes/import/github-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ export const importFromGithubDir = async (
rootDir
? node.type === 'blob'
: node.type === 'blob' &&
node.path.startsWith(dir) &&
node.path.startsWith(decodeURIComponent(dir)) &&
node.path.split('/').length === dir.split('/').length + 1,
);

const files = await Promise.all(
Object.values(dirFiles).map(async (file: any) => {
const filename = file.path.split('/')[file.path.split('/').length - 1];
const filename = decodeURIComponent(file.path.split('/')[file.path.split('/').length - 1]);
const content = decode(
await fetch(file.url, {
...(loggedInUser ? { headers: getGithubHeaders(loggedInUser) } : {}),
Expand Down

0 comments on commit 620898b

Please sign in to comment.