summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/haskell/xmonad-tv/src/Helpers
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-11-30 20:42:01 +0100
committerlassulus <lassulus@lassul.us>2018-11-30 20:42:01 +0100
commitf6b5bbc305c8e59d532d95e1c5b011b96fe1ed43 (patch)
tree4737d2417707eaaba3882ba5e873c1178af05ed2 /tv/5pkgs/haskell/xmonad-tv/src/Helpers
parent7f5431a4999fea9626df300f707aa8c62de894e3 (diff)
parent574356c63e8b11abd4fb7224cff9dca1c86332a2 (diff)
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/5pkgs/haskell/xmonad-tv/src/Helpers')
-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"])