[bin] Shorten drop's returned url to a 12-letter hex
This commit is contained in:
parent
ad2d0ad7de
commit
3af1491b89
|
@ -7,7 +7,7 @@ require 'securerandom'
|
||||||
require 'net/scp'
|
require 'net/scp'
|
||||||
|
|
||||||
file = Pathname.new(ARGV[0])
|
file = Pathname.new(ARGV[0])
|
||||||
new_name = SecureRandom.uuid + File.extname(file)
|
new_name = SecureRandom.hex(12) + File.extname(file)
|
||||||
abort "Och komm." unless file.exist? and file.readable?
|
abort "Och komm." unless file.exist? and file.readable?
|
||||||
|
|
||||||
url = URI.escape("https://drop.bascht.space/#{new_name}")
|
url = URI.escape("https://drop.bascht.space/#{new_name}")
|
||||||
|
|
Loading…
Reference in New Issue