From 09e4bdddc7415117cc27047ad0d7afe523f064c2 Mon Sep 17 00:00:00 2001 From: defanor Date: Sun, 5 Nov 2017 11:16:46 +0300 Subject: Read metadata Reading effective URI and content type (if those are available) now, aiming `curl -w` or similar commands. Not a particularly nice way, and complicates both the program and the configuration, but sometimes file name extensions are deceptive. --- Pancake/Configuration.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Pancake/Configuration.hs') diff --git a/Pancake/Configuration.hs b/Pancake/Configuration.hs index fa33d52..ff2e748 100644 --- a/Pancake/Configuration.hs +++ b/Pancake/Configuration.hs @@ -56,9 +56,12 @@ instance ToJSON Config instance Default Config where def = Config { commands = M.fromList - [ ("ssh", "scp \"${URI_REGNAME}:${URI_PATH}\" /dev/stdout") - , ("gopher", "curl \"${URI}\"")] + [ ("ssh", "scp \"${URI_REGNAME}:${URI_PATH}\" /dev/stdout" + ++ " && echo -e '\n-pancake-'") + , ("gopher", "curl \"${URI}\"" + ++ " -w \"\n-pancake-\n\"")] , defaultCommand = "curl -4 -L \"${URI}\"" + ++ " -w \"\n-pancake-\nuri: %{url_effective}\ntype: %{content_type}\n\"" , externalViewers = M.fromList $ map (flip (,) "emacsclient -n \"${FILE}\"") ["hs", "cabal", "c", "h", "el", "scm", "idr"] -- cgit v1.2.3