summary refs log tree commit diff
path: root/bin/up.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/up.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/up.sh b/bin/up.sh
index ef3ff6c7..a439c8f7 100644
--- a/bin/up.sh
+++ b/bin/up.sh
@@ -45,13 +45,27 @@ uploadScreen() {
 	upload "${temp}/capture.png"
 }
 
-args=$(setopt 'chs' "$@")
+uploadTerminal() {
+	temp
+	cat > "${temp}/term.html" <<-EOF
+	<!DOCTYPE html>
+	<title>${1}</title>
+	<style>
+	$(scheme -s)
+	</style>
+	EOF
+	ptee "$@" | shotty -Bcs >> "${temp}/term.html"
+	upload "${temp}/term.html"
+}
+
+args=$(setopt 'chst' "$@")
 eval set -- "$args"
 for opt; do
 	case "$opt" in
 		(-c) shift; fn=uploadCommand;;
 		(-h) shift; fn=uploadHi;;
 		(-s) shift; fn=uploadScreen;;
+		(-t) shift; fn=uploadTerminal;;
 		(--) shift; break;;
 	esac
 done