refactor: simplify docs and tidy up

pull/25/head
sgoudham 1 year ago committed by Hamothy
parent 60e5a22d25
commit 8fb5bbfb71

@ -26,7 +26,5 @@ jobs:
{{formulaName}} -> {{version}} {{formulaName}} -> {{version}}
Created by https://github.com/mislav/bump-homebrew-formula-action Created by https://github.com/mislav/bump-homebrew-formula-action
download-url: https://example.com/foo/${{ github.event.inputs.tag-name }}.tar.gz
env:
env: env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW }} COMMITTER_TOKEN: ${{ secrets.HOMEBREW }}

@ -0,0 +1,5 @@
{
"rust-analyzer.linkedProjects": [
"./Cargo.toml"
]
}

@ -1,6 +1,7 @@
# Contributing to git-view # Contributing to git-view
Thank you for your interest in contributing to this project! I really appreciate it! Thank you for your interest in contributing to this project! I really appreciate it!
Feel free to contribute pull requests for any additional features that you want!
# Got a Question? # Got a Question?

@ -11,7 +11,6 @@ exclude = [".github/**"]
[[bin]] [[bin]]
name = "git-view" name = "git-view"
path = "src/bin/git-view.rs"
[lib] [lib]
name = "git_view" name = "git_view"

@ -3,13 +3,12 @@
[![build](https://github.com/sgoudham/git-view/actions/workflows/build.yml/badge.svg)](https://github.com/sgoudham/git-view/actions/workflows/build.yml) [![build](https://github.com/sgoudham/git-view/actions/workflows/build.yml/badge.svg)](https://github.com/sgoudham/git-view/actions/workflows/build.yml)
[![crates.io](https://img.shields.io/crates/v/git-view)](https://crates.io/crates/git-view) [![crates.io](https://img.shields.io/crates/v/git-view)](https://crates.io/crates/git-view)
[![downloads](https://img.shields.io/crates/d/git-view)](https://crates.io/crates/git-view) [![downloads](https://img.shields.io/crates/d/git-view)](https://crates.io/crates/git-view)
[![license](https://img.shields.io/github/license/sgoudham/git-view)](LICENSE)
> A git sub-command to view your git repository in the web browser! > A git sub-command to view your git repository in the web browser!
## About ## About
Are you _**also**_ frustrated from moving your hands away from the keyboard to view your git repository in the browser? Are you _**also**_ frustrated from moving your hands away from the keyboard to view your git repository in the browser?
> Me too!!! > Me too!!!
@ -27,158 +26,84 @@ Are you _**also**_ frustrated from moving your hands away from the keyboard to v
- [ ] View Profile - [ ] View Profile
- [ ] View Current Directory - [ ] View Current Directory
Feel free to raise any issues or pull requests (after having read the [CONTRIBUTING.md](./CONTRIBUTING.md)!) for any additional features
that you want!
## Usage
![Usage](./docs/images/usage.png "Displays different usages of `git-view`")
## Installation ## Installation
### Cargo Binaries are available for **Windows**, **macOS** and **Linux** [here](https://github.com/sgoudham/git-view/releases/latest)
The _preferred_ way of installation is to manually install the provided binaries and update your `$PATH` variable to enable
the usage as `git view` globally. However, that being said, it also available on [crates.io](https://crates.io/crates/git-view) to allow installation
through the use of Rust's build tool and package manager `cargo`.
> If you do not have `cargo` available on your machine, you can download it [here](https://www.rust-lang.org/tools/install)
```shell ### Cargo
$ cargo install git-view
```
Refresh terminal & verify installation
```shell ```shell
$ git view --version cargo install git-view
git-view 0.1.0
``` ```
### Homebrew ### Homebrew
For `macOS` users, installation through [Homebrew](https://brew.sh/) is recommended.
```shell ```shell
$ brew tap sgoudham/tap brew tap sgoudham/tap
$ brew install git-view brew install git-view
``` ```
Refresh terminal & verify installation ## Usage
```shell
$ git view --version
git-view 0.1.0
```
### Binaries
Pre-compiled binaries are _always_ available with every single [release](https://github.com/sgoudham/git-view/releases) for **Windows**, **macOS** and **Linux**.
The examples shown below will showcase the installation of the binaries living within the local `git` directory but realistically, any path will
work if updated correctly within `$PATH`.
#### Windows
1. Download either `git-view-x86_64-pc-windows-msvc.zip` or `git-view-x86_64-pc-windows-gnu.zip`
2. Find local `git` directory
```shell
# CMD
$ where git
C:\Program Files\Git\cmd\git.exe
# PowerShell
$ (Get-Command git.exe).Path
C:\Program Files\Git\cmd\git.exe
```
3. `cd` into above path & extract downloaded binary zip
```shell
$ cd 'C:\Program Files\Git\cmd'
$ tar -xf git-view-x86_64-pc-windows-msvc.zip
# OR
$ tar -xf git-view-x86_64-pc-windows-gnu.zip
```
4. Ensure `%PATH%` is updated
```shell
# Only required if git-view exists within a path not already included within %PATH%
$ setx path "%path%;C:\your\path\here\bin"
```
5. Refresh terminal and verify installation
```shell
$ git view --version
git-view 0.1.0
```
#### Linux / macOS
1. Download `git-view-x86_64-unknown-linux-gnu.tar.gz` or `git-view-x86_64-unknown-linux-musl.tar.gz`
or `git-view-x86_64-apple-darwin.tar.gz`
2. Extract into your local directory
```shell ```shell
# Linux $ git view
$ tar -xf git-view-x86_64-unknown-linux-gnu.tar.gz # View https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_BRANCH
$ tar -xf git-view-x86_64-unknown-linux-musl.tar.gz
# macOS $ git view --remote remote
$ tar -xf git-view-x86_64-apple-darwin.tar.gz # View https://github.com/PROVIDED_REMOTE_USER/REPO/tree/CURRENT_BRANCH
```
3. Move into `~/bin` $ git view --remote remote --branch branch
# View https://github.com/PROVIDED_REMOTE_USER/REPO/tree/PROVIDED_BRANCH
```shell $ git view --commit
# Create ~/bin if it does not exist # View https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_COMMIT
$ mkdir -p ~/bin
$ mv git-view ~/bin
```
4. Set permissions for executable $ git view --commit efa38be50ad34d
# View https://github.com/TRACKED_REMOTE_USER/REPO/tree/efa38be50ad34d
```shell $ git view --issue
$ chmod 755 ~/bin/git-view # Given branch 'TICKET-123' or some other variation
``` # View https://github.com/TRACKED_REMOTE_USER/REPO/issues/123
5. Ensure `$PATH` is updated $ git view --suffix releases
# Given branch 'TICKET-123' or some other variation
# View https://github.com/TRACKED_REMOTE_USER/REPO/releases
```shell $ git view --print
# Only required if git-view exists within a path not already included within $PATH # Prints https://github.com/TRACKED_REMOTE_USER/REPO/tree/CURRENT_BRANCH
# Linux
$ echo 'export PATH=~/bin:$PATH' >> ~/.bashrc
$ source ~/.bashrc
# macOS
$ echo 'export PATH=~/bin:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile
``` ```
6. Verify installation ## Help
```shell ```shell
$ git view --version git-view 1.0.0
git-view 0.1.0 Goudham Suresh <sgoudham@gmail.com>
A git sub-command to view your git repository in the web browser
USAGE:
git-view [OPTIONS]
OPTIONS:
-r, --remote <name> The remote to view git repository on
[default: default remote]
-b, --branch <name> The branch to view git repository on
[default: current branch]
-c, --commit <hash> The commit to view git repository on
[default: current commit]
-s, --suffix <suffix> A suffix to append onto the git repository URL
-i, --issue Attempt to parse issue number and open issue link
-p, --print Don't open browser and print the URL
-h, --help Print help information
-V, --version Print version information
``` ```
## Help ## Contributing
![help](./docs/images/help.png "Contents displayed when running `git view -h`")
## Contributing
First, thanks for your interest in contributing to this project! Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) before contributing! Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) before contributing!
## License ## License
[MIT License](LICENSE) [MIT](LICENSE)
## Acknowledgement ## Acknowledgement

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Loading…
Cancel
Save