summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-11-30 09:03:52 +0100
committertv <tv@krebsco.de>2018-11-30 09:48:36 +0100
commit94a09258ad3202cfba1bcba8cdbf99b51f5aae86 (patch)
tree7142334df0f353d8d7da5430ef6cc14d09cfcf7d /tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs
parent4319a386800c8dd535fe8b7273539d258e3c6092 (diff)
tv xmonad: move to haskell packages
Diffstat (limited to 'tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs')
-rw-r--r--tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs b/tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs
new file mode 100644
index 000000000..1029d60be
--- /dev/null
+++ b/tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs
@@ -0,0 +1,15 @@
+module Helpers.Path where
+
+import qualified Data.List
+import qualified System.Directory
+import qualified System.IO.Unsafe
+
+
+findExecutable :: String -> FilePath
+findExecutable =
+ System.IO.Unsafe.unsafePerformIO . find
+ where
+ find name =
+ maybe failure id <$> System.Directory.findExecutable name
+ where
+ failure = error (Data.List.intercalate " " [name, "not found"])