summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2018-12-05 16:41:38 +0100
committermakefu <github@syntax-fehler.de>2018-12-05 16:41:38 +0100
commit48e1828a914159b7377d42ac7c34ef303a9b836f (patch)
treea5724be8669d0f1bd44910cddc2899eb72f1e8ab /tv/5pkgs/haskell/xmonad-tv/src/Helpers/Path.hs
parent1767369587d43aba5ec86780d85daf5e42812b8b (diff)
parent329abcefa2d6bc33f6fe55268f4019f65de1cd7e (diff)
Merge remote-tracking branch 'lass/master' into HEAD
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 0000000..1029d60
--- /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"])