summaryrefslogtreecommitdiff
path: root/.local/bin/up
blob: b224ee42661db826d38af1c2791c599e33d0581e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/local/bin/andy

func upload file {
	test $file != '-' || set file /dev/stdin
	curl (
		--retry-all-errors
		-X POST
		-H "Authorization: $TOKEN"
		-F "data=@$file"
		https://paste.thomasvoss.com
	)
}

set TOKEN `vlt raw Miscellaneous 'Mpaste (Key)'
test $#args -ge 2 || set args $args -
for $args[1..] {
	async upload $_
}
wait