hscrtmpl 1.4 → 1.5
raw patch · 8 files changed
+49/−55 lines, 8 filesdep −regex-compatdep −time-locale-compatsetup-changed
Dependencies removed: regex-compat, time-locale-compat
Files
- LICENSE +13/−29
- README.md +1/−0
- Setup.hs +0/−8
- changelog.md +9/−0
- hscrtmpl.cabal +8/−7
- hscrtmpl.hs +8/−6
- stack.yaml +4/−0
- util/prefs/boring +6/−5
LICENSE view
@@ -1,31 +1,15 @@-Copyright Dino Morelli 2013-2015--All rights reserved.--Redistribution and use in source and binary forms, with or without-modification, are permitted provided that the following conditions are met:-- * Redistributions of source code must retain the above copyright- notice, this list of conditions and the following disclaimer.-- * Redistributions in binary form must reproduce the above- copyright notice, this list of conditions and the following- disclaimer in the documentation and/or other materials provided- with the distribution.-- * Neither the name of Dino Morelli nor the names of other- contributors may be used to endorse or promote products derived- from this software without specific prior written permission.+Copyright (c) 2013-2016, Dino Morelli <dino@ui3.info> -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+Permission to use, copy, modify, and/or distribute this software+for any purpose with or without fee is hereby granted, provided+that the above copyright notice and this permission notice appear+in all copies. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL+WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE+AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA+OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR+PERFORMANCE OF THIS SOFTWARE.
README.md view
@@ -16,6 +16,7 @@ - Download the cabalized source package [from Hackage](http://hackage.haskell.org/package/hscrtmpl) - Get the source with darcs: `$ darcs get http://hub.darcs.net/dino/hscrtmpl`+- Get the source with stack: `$ stack unpack hscrtmpl` - If you're just looking, [browse the source](http://hub.darcs.net/dino/hscrtmpl)
Setup.hs view
@@ -1,10 +1,2 @@-#! /usr/bin/env runhaskell---- Copyright: 2013 Dino Morelli--- License: BSD3 (see LICENSE)--- Author: Dino Morelli <dino@ui3.info>- import Distribution.Simple-- main = defaultMain
changelog.md view
@@ -1,3 +1,12 @@+1.5 (2016-11-18)++ * Changed license from BSD3 to ISC+ * Moved copyright year up to 2016+ * Switched build and execution from cabal/runhaskell to stack+ * Commented out example code that uses regexp, it imposes more deps+ * Some changes to avoid defaultTimeLocale confusion++ 1.4 (2015-07-04) * Added time-locale-compat for backwards compatibility
hscrtmpl.cabal view
@@ -1,21 +1,22 @@ name: hscrtmpl-version: 1.4+version: 1.5 cabal-version: >= 1.8 build-type: Simple-license: BSD3+license: ISC license-file: LICENSE-copyright: 2013-2015 Dino Morelli+copyright: 2013-2016 Dino Morelli author: Dino Morelli maintainer: Dino Morelli <dino@ui3.info>-stability: experimental+stability: stable homepage: http://hub.darcs.net/dino/hscrtmpl synopsis: Haskell shell script template description: A template for writing shell scripts in Haskell. Contains some useful functions and examples of things commonly done in bash. category: Application, Console, Scripting-tested-with: GHC >= 7.10.1+tested-with: GHC >= 8.0.1 extra-source-files: changelog.md README.md+ stack.yaml TODO.md util/prefs/boring @@ -30,6 +31,6 @@ build-depends: base >= 3 && < 5 , directory , process- , regex-compat+ --, regex-compat , time- , time-locale-compat+ --, time-locale-compat
hscrtmpl.hs view
@@ -1,4 +1,5 @@-#! /usr/bin/env runhaskell+#! /usr/bin/env stack+{- stack runghc -} {- This is a 'skeleton file' for writing shell scripts with Haskell @@ -24,14 +25,15 @@ import Control.Monad import Data.Time--- For backwards compatibility with GHC < 7.10-import Data.Time.Locale.Compat ( defaultTimeLocale )+import Data.Time.Format ( defaultTimeLocale )+-- Or use time-locale-compat for backwards compatibility with GHC < 7.10+--import Data.Time.Locale.Compat ( defaultTimeLocale ) import System.Directory import System.Environment import System.Exit import System.Process import Text.Printf-import Text.Regex+--import Text.Regex main :: IO ()@@ -79,8 +81,8 @@ -- program args stdin exitcode stdout stderr -- regular expressions (Text.Regex)- print $ matchRegex -- (see bash docs for =~- (mkRegex "a(.)b(.)") "axby" -- and BASH_REMATCH)+ --print $ matchRegex -- (see bash docs for =~+ -- (mkRegex "a(.)b(.)") "axby" -- and BASH_REMATCH) -- Handy date-stamping logM function below logM "Example of a log message"
+ stack.yaml view
@@ -0,0 +1,4 @@+resolver: lts-7.9++packages:+- '.'
util/prefs/boring view
@@ -1,7 +1,7 @@ # This file contains a list of extended regular expressions, one per # line. A file path matching any of these expressions will be filtered # out during `darcs add', or when the `--look-for-adds' flag is passed-# to `darcs whatsnew' and `record'. The entries in ~/.darcs/boring (if+# to `darcs whatsnew' and `record'. The entries in ~/.darcs/boring (if # it exists) supplement those in this file. # # Blank lines, and lines beginning with an octothorpe (#) are ignored.@@ -45,11 +45,8 @@ # cabal intermediates \.installed-pkg-config \.setup-config-# cabal sandbox-^\.cabal-sandbox(/|$)-cabal\.sandbox\.config # standard cabal build dir, might not be boring for everybody-^dist(/|$)+# ^dist(/|$) # autotools (^|/)autom4te\.cache($|/) (^|/)config\.(log|status)$@@ -121,3 +118,7 @@ (^|/)\.lock-wscript$ # mac os finder (^|/)\.DS_Store$+# emacs saved sessions (desktops)+(^|.*/)\.emacs\.desktop(\.lock)?$++(^|/).stack-work($|/)