mmsyn3 (empty) → 0.1.0.0
raw patch · 5 files changed
+74/−0 lines, 5 filesdep +basedep +directorysetup-changed
Dependencies added: base, directory
Files
- ChangeLog.md +5/−0
- EndOfExe.hs +22/−0
- LICENSE +20/−0
- Setup.hs +2/−0
- mmsyn3.cabal +25/−0
+ ChangeLog.md view
@@ -0,0 +1,5 @@+# Revision history for mmsyn3++## 0.1.0.0 -- YYYY-mm-dd++* First version. Released on an unsuspecting world.
+ EndOfExe.hs view
@@ -0,0 +1,22 @@+module EndOfExe where++import qualified System.Directory as D (findExecutable)+import Data.Maybe (isJust)+import System.IO.Unsafe (unsafePerformIO)++-- | Function that is used instead of System.Info.os to check whether the executable ends in .exe+endOfExecutable :: String -> IO String +endOfExecutable ys = do+ xs <- D.findExecutable ys+ if isJust xs + then return ""+ else do+ zs <- D.findExecutable (ys ++ ".exe")+ if isJust zs+ then return ".exe"+ else error ("Please, install the executable " ++ ys ++ " into the directory in the PATH variable!")+ +-- | Function that is used to concat the endOfExecutable to the name of the program. You can use showE \"nameOfExecutable\" e. g. inside the System.Process.callCommand as the name of the executable+showE :: String -> String+showE xs | null xs = []+ | otherwise = xs ++ unsafePerformIO (endOfExecutable xs)
+ LICENSE view
@@ -0,0 +1,20 @@+Copyright (c) 2019 OleksandrZhabenko++Permission is hereby granted, free of charge, to any person obtaining+a copy of this software and associated documentation files (the+"Software"), to deal in the Software without restriction, including+without limitation the rights to use, copy, modify, merge, publish,+distribute, sublicense, and/or sell copies of the Software, and to+permit persons to whom the Software is furnished to do so, subject to+the following conditions:++The above copyright notice and this permission notice shall be included+in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ mmsyn3.cabal view
@@ -0,0 +1,25 @@+-- Initial mmsyn3.cabal generated by cabal init. For further+-- documentation, see http://haskell.org/cabal/users-guide/++name: mmsyn3+version: 0.1.0.0+synopsis: A small library to deal with executable endings+-- description:+homepage: http://hackage.haskell.org/package/mmsyn3+license: MIT+license-file: LICENSE+author: OleksandrZhabenko+maintainer: olexandr543@yahoo.com+-- copyright:+category: System+build-type: Simple+extra-source-files: ChangeLog.md+cabal-version: >=1.10++library+ exposed-modules: EndOfExe+ -- other-modules:+ -- other-extensions:+ build-depends: base >=4.11 && <4.13, directory >=1.3 && <1.4+ -- hs-source-dirs:+ default-language: Haskell2010