]> git.armaanb.net Git - bin.git/commitdiff
Rewrite upl in python
authorArmaan Bhojwani <code@armaanb.net>
Tue, 29 Dec 2020 19:07:00 +0000 (14:07 -0500)
committerArmaan Bhojwani <code@armaanb.net>
Tue, 29 Dec 2020 19:07:00 +0000 (14:07 -0500)
upl [new file with mode: 0755]

diff --git a/upl b/upl
new file mode 100755 (executable)
index 0000000..3f494f5
--- /dev/null
+++ b/upl
@@ -0,0 +1,20 @@
+#!/usr/bin/env python3
+
+import os.path
+from shutil import copyfile
+import sys
+
+endp = "https://s3.us-east-2.wasabisys.com/armaan-public/"
+wabin = "/home/armaa/.local/mnt/public/"
+inp = sys.argv[1]
+
+if len(sys.argv) >= 3:
+    out = sys.argv[2]
+else:
+    out = inp
+
+if not out:
+    out = os.path.basename(inp)
+
+copyfile(inp, wabin + out)
+print(endp+out)