Skip to content

Commit

Permalink
feat: better install script
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnarus-G committed Jun 12, 2024
1 parent a87e2ac commit 0e2692d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,35 @@ Yet another todo app, because I'm opinionated about the dumbest things.
- [x] CLI for efficiency
- [x] Local Persistence Option
- [x] Soft Delete Done Items
- [x] Permanent Deletion
- [x] Permanent Deletion (Drap-n-drop to trash bin)
- [ ] Remind Command: /r (Desktop Notifications)
- [ ] Remote Persistence Option

## Install

### Recommended Option

```sh
git clone https://github.com/Gnarus-G/mynd
cd mynd
sh install.sh
curl -fsSL https://raw.githubusercontent.com/Gnarus-G/mynd/main/install.sh | sh
```

This depends on you having installed [bun](https://bun.sh/) and [rust](https://doc.rust-lang.org/cargo/getting-started/installation.html)
This depends on you having installed [bun](https://bun.sh/) and [rust](https://doc.rust-lang.org/cargo/getting-started/installation.html); `git` as well, but you
probably already have that.

### Other Options

Find the executables in the [releases](https://github.com/Gnarus-G/mynd/releases).

## Usage

Start up the GUI.

```sh
mynd
todo gui
```

Or just call `mynd` directly, which is what `todo gui` does.

At any point you can pull up your terminal and add a todo item like so.

```sh
Expand Down
21 changes: 18 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
set -xe;

bun tauri build;
OPT_DIR=~/.local/opt/mynd/
BIN_DIR=~/.local/bin/

rm -rf $OPT_DIR
mkdir -p $OPT_DIR

cd $OPT_DIR

git clone https://github.com/Gnarus-G/mynd .

bun install;

NO_STRIP=true bun tauri build;
cargo build --manifest-path=./src-tauri/Cargo.toml --release -p todo;

cd src-tauri;
cargo build --release -p todo;
sudo cp target/release/mynd target/release/todo ~/.local/bin/

cp target/x86_64-unknown-linux-gnu/release/mynd $BIN_DIR
cp target/release/todo $BIN_DIR
10 changes: 10 additions & 0 deletions src-tauri/todo/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use std::os::unix::process::CommandExt;

use anyhow::Context;
use clap::{Parser, Subcommand};
use colored::Colorize;
use todo::Todos;
Expand Down Expand Up @@ -26,6 +29,9 @@ enum Command {
/// List all todos that aren't done.
Ls {},

/// Launch the GUI (mynd). Assuming it's in the path.
Gui,

/// Read and save todos from a given file
Import(import::ImportArgs),

Expand Down Expand Up @@ -72,6 +78,10 @@ fn main() -> anyhow::Result<()> {
Command::Import(a) => a.handle()?,
Command::Config(a) => a.handle()?,
Command::Rm(a) => a.handle()?,
Command::Gui => {
let err = std::process::Command::new("mynd").exec();
return Err(err).context("failed to run the executable `mynd`. See the README @ https://github.com/Gnarus-G/mynd");
}
},
None => match args.message {
Some(message) => {
Expand Down

0 comments on commit 0e2692d

Please sign in to comment.