slate 0.9.0.0 → 0.10.0.0
raw patch · 3 files changed
+18/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +3/−1
- slate.cabal +2/−2
- src/Lib.hs +13/−2
README.md view
@@ -85,11 +85,13 @@ 00 - My <b>first</b> note. </pre> -Lists are stored in `~/.config/slate/` and their default name is the name of your current directory. You can use any other name you want using the `--name` option.+Lists are stored in `~/.config/slate/` and their default name is the name of your current directory. You can use any other name you want using the `--name` option or by adding a `.slate` file containing the name you want to use. ## Configuration The following configuration options can be set in `~/.config/slate/config.toml` (you'll have to create this file).++You can check out [config.example.toml](https://github.com/evuez/slate/blob/master/config.example.toml) for a configuration example. ### Callbacks
slate.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 6e60912378429734582892684e88ba61f79188de0112612ec1fb3ba8ebffd3d2+-- hash: 05ce519ad09a3080cf323932dc67f8f23ef49a1548fe61dedd2c0da298836bf7 name: slate-version: 0.9.0.0+version: 0.10.0.0 synopsis: A note taking CLI tool. description: Please see the README on Github at <https://github.com/evuez/slate#readme> homepage: https://github.com/evuez/slate#readme
src/Lib.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE LambdaCase #-} module Lib ( initialize@@ -8,12 +9,14 @@ import AnsiStyle (toAnsi) import qualified Data.HashMap.Lazy as M (lookup)+import Data.Maybe (listToMaybe) import Data.Semigroup ((<>)) import Data.String (fromString) import Data.String.Conversions (convertString) import Options.Applicative import System.Directory ( createDirectoryIfMissing+ , doesFileExist , getCurrentDirectory , getHomeDirectory , removeFile@@ -151,8 +154,16 @@ getSlateName :: IO String getSlateName = do- directory <- getCurrentDirectory- return $ takeBaseName directory+ d <- getCurrentDirectory+ let headOrFail =+ \x ->+ maybe+ (error "The .slate file in this directory shouldn't be empty.")+ id+ (listToMaybe x)+ doesFileExist (d ++ "/.slate") >>= \case+ True -> readFile (d ++ "/.slate") >>= (return . headOrFail . lines)+ False -> return $ takeBaseName d getConfigDirectory :: IO String getConfigDirectory = do