diff options
author | Mathias Bynens <mathias@qiwi.be> | 2012-07-27 15:59:46 +0200 |
---|---|---|
committer | Mathias Bynens <mathias@qiwi.be> | 2012-07-27 15:59:46 +0200 |
commit | c03c5412fcd38aef2ccb3fd72be34fe2d557d23f (patch) | |
tree | 92230e95cabbac8128f4777bb52cc815549e17a6 | |
parent | 390d0fd632da9ebe1bb2890bd7021fb9c63503ad (diff) | |
download | dotfiles-c03c5412fcd38aef2ccb3fd72be34fe2d557d23f.tar.gz dotfiles-c03c5412fcd38aef2ccb3fd72be34fe2d557d23f.tar.bz2 dotfiles-c03c5412fcd38aef2ccb3fd72be34fe2d557d23f.zip |
.functions: Attempt to make `server` open the browser *after* the server has started
-rw-r--r-- | .functions | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -19,7 +19,7 @@ dataurl() { # Start an HTTP server from a directory, optionally specifying the port function server() { local port="${1:-8000}" - open "http://localhost:${port}/" + sleep 1 && open "http://localhost:${port}/" & # Set the default Content-Type to `text/plain` instead of `application/octet-stream` # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" |