Skip to content

Commit 6d667ab

Browse files
committed
feat[pb]: allow specifying domain via env
1 parent 1802ac2 commit 6d667ab

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

scripts/README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
# Scripts of pastebin-worker
22

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

55
## `pb`: paste things on command line
66

7-
This is a wrapper script to make it easier to use our pastebin.
7+
This is a wrapper script to make it easier to use our pastebin.
88

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

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

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

18-
**Zsh completion**: download `_pb` in a folder within your zsh `fpath`
18+
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.
1919

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

22-
**Usage**:
22+
**fish completion**: download `pb.fish` in a folder within your fish `fish_complete_path`
23+
24+
**Usage**:
2325

2426
```text
2527
$ pb -h

scripts/pb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

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

66
script_name=${0##*/}

0 commit comments

Comments
 (0)