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

[now-cli] Render correct command for now ls $path_alias_url #2988

Merged
merged 4 commits into from Sep 11, 2019

Conversation

TooTallNate
Copy link
Member

@TooTallNate TooTallNate commented Sep 10, 2019

Previously, if you ran now ls with a URL for a path alias, then an error message Cannot read property 'replace' of undefined would occur.

Now, a message is logged saying to instead run now alias ls $url which is the correct command to get path rules relevant to a path alias URL.

$ now ls rules.domain.com
> Found matching path alias: rules.domain.com
> Please run `now alias ls rules.domain.com` instead

Fixes #2987.

Previously, if you ran `now ls` with a URL for a path alias, then an
error message `Cannot read property 'replace' of undefined` would occur.

Now, a message is logged saying to instead run `now alias ls $url` which
is the correct command to get path rules relevant to a path alias URL.

> Found matching path alias: rules.domain.com
> Please run `now alias ls rules.domain.com` instead

Fixes #2987.
@TooTallNate TooTallNate added automerge triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked area: cli labels Sep 10, 2019
@styfle
Copy link
Member

styfle commented Sep 10, 2019

@TooTallNate Is it possible to add a test for this behavior?

@codecov-io
Copy link

codecov-io commented Sep 11, 2019

Codecov Report

Merging #2988 into canary will decrease coverage by 2.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           canary    #2988      +/-   ##
==========================================
- Coverage   13.37%   11.33%   -2.05%     
==========================================
  Files         268      268              
  Lines       10344    10096     -248     
  Branches     1218     1306      +88     
==========================================
- Hits         1384     1144     -240     
+ Misses       8898     8862      -36     
- Partials       62       90      +28
Impacted Files Coverage Δ
src/util/output/create-output.ts 31.25% <0%> (-12.34%) ⬇️
src/util/dev/server.ts 61.21% <0%> (-5.69%) ⬇️
src/util/prefer-v2-deployment.ts 56.25% <0%> (-5.66%) ⬇️
src/util/dev/yarn-installer.ts 85.71% <0%> (-5.03%) ⬇️
src/util/dev/builder.ts 73.07% <0%> (-4.35%) ⬇️
src/util/get-files.ts 87.77% <0%> (-3.89%) ⬇️
src/util/projects/get-project-by-id-or-name.ts 25% <0%> (-3.58%) ⬇️
src/util/dev/builder-cache.ts 77.27% <0%> (-3.48%) ⬇️
src/commands/list.js 0% <0%> (ø) ⬆️
src/util/metrics.ts 70.58% <0%> (+2.4%) ⬆️

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 61c3b94...0ec4580. Read the comment docs.

@kodiakhq kodiakhq bot merged commit f15deaa into canary Sep 11, 2019
@kodiakhq kodiakhq bot deleted the fix/gh-2987 branch September 11, 2019 15:48
styfle pushed a commit that referenced this pull request Sep 17, 2019
Previously, if you ran `now ls` with a URL for a path alias, then an
error message `Cannot read property 'replace' of undefined` would occur.

Now, a message is logged saying to instead run `now alias ls $url` which
is the correct command to get path rules relevant to a path alias URL.

> Found matching path alias: rules.domain.com
> Please run `now alias ls rules.domain.com` instead

Fixes #2987.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cli triaged: bug Issue or PR has been reviewed by a maintainer and work is being tracked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read property 'replace' of undefined
4 participants