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

Fix bug when running shorten with no arguments #32

Merged
merged 1 commit into from
May 29, 2020

Conversation

SebJones
Copy link
Contributor

@SebJones SebJones commented May 29, 2020

What:

This PR fixes an error that is thrown when running shorten with no arguments (to format the redirects file).

Why:

addProtocolIfMissing() was being called on the on the longLink (first) argument from the command line, before checking if it had actually been provided.

How:

index.js now checks for the existence of the first argument before attempted to modify it.

Checklist:

  • Documentation N/A
  • Tests N/A
  • Ready to be merged
  • Added myself to contributors table

Additional commments:

No tests currently for non utility function code - should we add some?

@codecov
Copy link

codecov bot commented May 29, 2020

Codecov Report

Merging #32 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #32   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           38        38           
  Branches         8         8           
=========================================
  Hits            38        38           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c46bed...d1575aa. Read the comment docs.

Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks!

@kentcdodds kentcdodds merged commit fce639c into kentcdodds:master May 29, 2020
@kentcdodds
Copy link
Owner

@all-contributors please add @SebJones for code

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @SebJones! 🎉

@kentcdodds
Copy link
Owner

🎉 This PR is included in version 2.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants