Skip to content

Commit

Permalink
feat[pb]: allow specifying domain via env
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL committed Apr 16, 2024
1 parent 1802ac2 commit 6d667ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# Scripts of pastebin-worker

This directory contains a set of scripts that facilitate the usage and development of pastebin-worker.
This directory contains a set of scripts that facilitate the usage and development of pastebin-worker.

## `pb`: paste things on command line

This is a wrapper script to make it easier to use our pastebin.
This is a wrapper script to make it easier to use our pastebin.

**Requirements**: `bash`, `jq`, `getopt`, `curl`

**Installation**: download `pb` to your `PATH` and give it execution permission. For example:
**Installation**: download `pb` to your `PATH` and give it execution permission. For example:

```shell
$ wget https://github.com/SharzyL/pastebin-worker/raw/goshujin/scripts/pb
$ install -Dm755 pb ~/.local/bin
```

**Zsh completion**: download `_pb` in a folder within your zsh `fpath`
By default the script will use the instance on `https://shz.al`, you can either modify the script itself, or specify the `PB_DOMAIN` environment variable to use other instances.

**fish completion**: download `pb.fish` in a folder within your fish `fish_complete_path`
**Zsh completion**: download `_pb` in a folder within your zsh `fpath`

**Usage**:
**fish completion**: download `pb.fish` in a folder within your fish `fish_complete_path`

**Usage**:

```text
$ pb -h
Expand Down
2 changes: 1 addition & 1 deletion scripts/pb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

domain="https://shz.al"
domain="${PB_DOMAIN:-https://shz.al}"
hist_file="${XDG_CONFIG_DIR:-$HOME/.config}/pb_hist"

script_name=${0##*/}
Expand Down

0 comments on commit 6d667ab

Please sign in to comment.