Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(gatsby-source-airtable): Duplicate Dot in File Extension #455

Open
roNn23 opened this issue Sep 11, 2023 · 4 comments
Open

bug(gatsby-source-airtable): Duplicate Dot in File Extension #455

roNn23 opened this issue Sep 11, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@roNn23
Copy link

roNn23 commented Sep 11, 2023

Describe the bug

When creating a RemoteFileNode, there seems to be an issue with the file extension having a duplicate dot. This is due to the way the extension is being appended in the code.

The code:

ext: extension ? `.${extension}` : undefined,

results in a double dot before the file extension, e.g., ..jpg, since the extension variable already contains a dot.

Expected behavior

The file extension should only have one dot before it, e.g., .jpg.

Solution:

To fix this, the dot before extension in the template literal can be removed:

ext: extension || undefined

Here is the code line:

ext: extension ? `.${extension}` : undefined,

@roNn23 roNn23 added the bug Something isn't working label Sep 11, 2023
@moonmeister
Copy link
Contributor

Hey! Thanks for the report. You interested in submitting a PR?

@moonmeister
Copy link
Contributor

Ps, if you look at line 300 it looks like 309 is a duplicate of this line. So no undefined check may be needed.

@239yash
Copy link

239yash commented Sep 22, 2023

@moonmeister Can you assign this to me? I will raise the PR

@239yash
Copy link

239yash commented Sep 22, 2023

@moonmeister Please review this PR. We can simplify this further

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants