Open maxheld83 opened 5 years ago
Looks like someone has had that issue. We might be able to reuse the given code here and give it a try.
ah sorry, my original issue title was a bit misleading; we're actually looking for copying the other way around here – we want to get the local host url localhost::8080
emitted from the script into the clipboard, so people can quickly copy paste it into their browser.
So we need a little CLI tool which allows us to write stuff to the clipboard.
I found the tool xclip in a couple of articles regarding the subject so maybe that one is worth a try.
https://superuser.com/questions/370160/manipulate-system-clipboard-via-bash-script
yes, it seems like xclip is the ticket! Unfortunately, it would only work on unix-es (Linux, macOS), but so would the docker call, so that's quite something.
One way to go about this would be to build a small wrapper function around the docker run
call here, and have its emitted local host url directly piped to xclip
.
Come to think of it, it might be better of this were an option – overwriting the clipboard is potentially destructive (it would presumably overwrite whatever is in the current clipboard) and uncommon for apps, so it might cause some frustration as a default.
So maybe this a bit too risky.
that might be a halfway-point to #10