Skip to content

Commit

Permalink
feat: binary install and update readme (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaP106 authored Aug 30, 2024
1 parent 6820e9c commit 13f0566
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 37 deletions.
50 changes: 35 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,59 +30,79 @@ docker run -it --name mynav --rm ubuntu bash -c '
'
```

### Build from source
>
>Note: Requires go to be installed
### Binary installation

```bash
curl -fsSL https://raw.githubusercontent.com/GianlucaP106/mynav/main/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/GianlucaP106/mynav/main/install.bash | bash
```

### Add to PATH
> **See all binaries on the [latest release](https://github.com/GianlucaP106/mynav/releases/latest) page.**
### Build from source

```bash
# go to mynav's configuration directory
mkdir ~/.mynav/ 2>/dev/null | true
cd ~/.mynav

# clone the repo
git clone https://github.com/GianlucaP106/mynav src
cd src

# build the project
go build -o ~/.mynav/mynav

# add to path
export PATH="$PATH:$HOME/.mynav"

# optionally delete the source code
cd ~/.mynav
rm -rf src
```

#### Supported platforms

mynav is only supported for Linux and MacOS.

## Usage

```bash
mynav
```

>Note:
>
> - mynav will look for a configuration in the current or any parent directory, otherwise will ask to initialize the current directory.
> - mynav can be initialized in multiple independant directories, but not nested.
> - mynav cannot be initialized in the user home directory.
#### Configuration

- mynav will look for a configuration in the current or any parent directory, otherwise will ask to initialize the current directory.
- mynav can be initialized in multiple independant directories, but not nested.
- mynav cannot be initialized in the user home directory.

## Features

### Workspace and session management
#### Workspace and session management

- Organize workspaces by topic.
- Create, view, update and delete workspaces and topics.
- View information about workspaces, such as git information, activity, descriptions...
- Enter a session for each workspace, allowing to swap between workspaces easilty (uses tmux).
- Create, view, update and delete workspace sessions.

### Tmux session, windows and panes
#### Tmux session, windows and panes

- View tmux session, windows and panes.
- Create, view. update and delete tmux sessions.
- View a preview of tmux sessions.
- A number of tmux commands as keymaps.

### Simple development oriented Github client
#### Simple Github client

- Authenticate using device authentication or personal access token authentication.
- View github profile info, repos and PRs.
- Open browser/Copy url of PRs and repos.
- Clone repo directly to a workspace, avoiding the need to use your browser.

## Keymaps
>
> ### Use '?' in the TUI to see all the key maps

#### Use '?' in the TUI to see all the key maps

#### Global

Expand Down
47 changes: 47 additions & 0 deletions install.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#! /bin/bash

echo "Installing mynav..."

echo "Initializing configuration directory at ~/.mynav"
mkdir ~/.mynav/ 2>/dev/null | true
cd ~/.mynav

latest_release=$(curl -sL "https://api.github.com/repos/GianlucaP106/mynav/releases/latest")
latest_tag=$(echo "$latest_release" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')

echo "Installing latest release ${latest_tag}"

os="$(uname -s)"
arch="$(uname -m)"

echo "Detected platform ${os}-${arch}"

file="mynav_${os}_${arch}.tar.gz"

curl -s -L -o build.tar.gz https://github.com/GianlucaP106/mynav/releases/download/${latest_tag}/${file}

tar -xzf build.tar.gz 2>/dev/null
if [ $? -ne 0 ]; then
echo "Failed to install mynav. Platform not supported."
exit
fi

rm build.tar.gz

directory="$HOME/.mynav"
if echo "$PATH" | grep -q "$directory"; then
echo "Successfully installed mynav at ~/.mynav!"
else
echo "Adding ~/.mynav to PATH"
rc_files=(~/.bashrc ~/.zshrc ~/.profile ~/.bash_profile ~/.bash_login ~/.cshrc ~/.tcshrc)
for file in "${rc_files[@]}"; do
if [ -f "$file" ]; then
echo "Adding to $file"
echo '# mynav path export' >>"$file"
echo 'export PATH="$PATH:$HOME/.mynav"' >>"$file"
break
fi
done
echo "Successfully installed mynav at ~/.mynav!"
echo "Restart your terminal session."
fi
22 changes: 0 additions & 22 deletions install.sh

This file was deleted.

0 comments on commit 13f0566

Please sign in to comment.