Skip to content

Commit

Permalink
make gh-url executable
Browse files Browse the repository at this point in the history
  • Loading branch information
aviaryan committed Oct 13, 2018
1 parent 2df72cb commit ceba6ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ Script: [empty-trash](empty-trash)
empty-trash
```

### 🏹 Create custom short link for a GitHub URL using git.io

Script: [gh-url](gh-url)

```sh
gh-url <url-to-shorten> <short-code>
```

### 🤐 ZIP without .DS_Store on a Mac

Script: [maczip](maczip)
Expand All @@ -130,13 +138,3 @@ Script: [delete-ss](delete-ss)
```sh
delete-ss
```

### 🏹 Custom short GitHub URL

Script: [gh-url](gh-url)

```sh
gh-url <url-to-shorten> <custom-code>
```

*It will shorten your GitHub URLs to https://git.io/{custom-code}.*
3 changes: 2 additions & 1 deletion gh-url
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
curl -i https://git.io -F "url=$1" -F "code=$2"
curl -s -i https://git.io -F "url=$1" -F "code=$2" | grep -Fi Location

# will not return any output if short code is already taken
# https://github.com/aashutoshrathi/awesome-bashrc/issues/15
# https://blog.github.com/2011-11-10-git-io-github-url-shortener/

1 comment on commit ceba6ba

@aashutoshrathi
Copy link
Contributor

Choose a reason for hiding this comment

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

🙏

Please sign in to comment.