Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions AddToPath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Invoke `pgdiff` Anywhere

## 1. Create and open a script directory.

```bash
mkdir ~/bash/ && cd ~/bash/
```

## 2. Clone the `pgdiff` repo into the directory

```bash
git clone https://github.com/denvaar/pgdiff.git
```

## 3. Copy the working directory

```bash
cd pgdiff && pwd
```

It will look something like this on a Mac:

```bash
/Users/USER/bash/pgdiff
```

## 4. Add directory to path


```bash
export PATH=$PATH:/paste/working/directory/bash/pgdiff
```

## 5. Confirm it works

`cd` to another directory and invoke `pgdiff`

```bash
cd ~/ && pgdiff
```

## 6. ???

## 7. Profit
12 changes: 12 additions & 0 deletions pgdiffD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# If the path variable is set per the instructions, this script can be invoked with
# bash pgdiffD

echo "Enter your DB URL"
read -p "url: " -s url;

echo ''

pgdiff $url -d

19 changes: 19 additions & 0 deletions pgdiffT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

# If the path variable is set per the instructions, this script can be invoked with
# bash pgdiffT

read -p "Enter your DB url" -s url;
echo ""
read -p "Enter the single table you want to monitor: " -e table

echo ""
pgdiff $url -t $table -k enter

read -p "Press 'enter' to take the next snapshot"

pgdiff $url -t $table

read -p "press ctrl + c to keep the data, or press 'enter' to delete the data"

pgdiff $url -d