toptal / gitignore.io

Create useful .gitignore files for your project
https://www.toptal.com/developers/gitignore
MIT License
8.21k stars 623 forks source link

zsh installation instructions wrong #608

Closed lukens closed 1 year ago

lukens commented 1 year ago

The current command line installation instructions for zsh don't work, and cause all output to have an n placed after it.

Current command given in the instructions is:

echo "function gi() { curl -sLw "\n" https://www.toptal.com/developers/gitignore/api/\$@ ;}" >> \
~/.zshrc && source ~/.zshrc

However, this needs extra escaping, as the "\n" is ending up as just n.

I found the following worked:

echo "function gi() { curl -sLw \"\\\n\" https://www.toptal.com/developers/gitignore/api/\$@ ;}" >> \
~/.zshrc && source ~/.zshrc

I've tested on macOs and Linux, and the same applies to both.

Versions used: macOs: zsh 5.8.1 (x86_64-apple-darwin22.0) macOS 13.2 (22D49)

Linux: zsh 5.8.1 (aarch64-unknown-linux-gnu) Ubuntu 22.04.1 LTS

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

filipechagas commented 1 year ago

Hi @lukens ! Thank you for pointing it out.

We'd happily accept a PR with the fix if you're willing to do that. Otherwise, we'll be adding this to our backlog.

lukens commented 1 year ago

@filipechagas - I thought I'd take a quick look, but I'm struggling to find the source of this text. Is it in this repository?

filipechagas commented 1 year ago

@lukens true! This documentation page is powered by Gitbooks. I have added this issue to our backlog and will work on the fix soon (tm).

filipechagas commented 1 year ago

The docs are currently stored in https://github.com/joeblau/gitignore.io-docs

filipechagas commented 1 year ago

Thank you again for the report, @lukens ! Your changes have been published

lukens commented 1 year ago

@filipechagas - it looks like only the macOS instructions have been updated, but this also applies to zsh for Linux, as far as I can tell.

This is really my fault, as it only said "macOS" in the subject. I'd started typing the issue out before thinking to test in Linux too, and it seems I then forgot to go back and change the subject (which I have now done).

filipechagas commented 1 year ago

@lukens Truuuue! That's totally my fault. I just published the change for linux instructions as well. It should pop in in a couple of minutes after cache revalidation.

Thank you again for pointing it out!!!