Browse Source

cabalized

master
Michael Snoyman 9 years ago
parent
commit
c2a4157ce2
  1. 1
      .gitignore
  2. 20
      LICENSE
  3. 2
      Setup.hs
  4. 4
      Shared.hs
  5. 6
      merge.hs
  6. 41
      yesod-scaffold.cabal

1
.gitignore

@ -3,3 +3,4 @@
*.o
hsfiles/
yesod-scaffold/
dist/

20
LICENSE

@ -0,0 +1,20 @@
Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/
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.

2
Setup.hs

@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain

4
Shared.hs

@ -25,8 +25,8 @@ createHsFiles root branch fp = do
liftIO $ createTree $ directory fp
liftIO
$ runResourceT
$ mapM_ (yield . toPair root . fromText) (lines files)
$ mapM_ (yield . toPair . fromText) (lines files)
$$ createTemplate
=$ writeFile fp
where
toPair root fp' = (fp', readFile $ root </> fp')
toPair fp' = (fp', readFile $ root </> fp')

6
merge.hs

@ -3,11 +3,7 @@
module Main (main) where
import ClassyPrelude.Conduit
import Shelly (shellyNoDir, rm_rf, run_, run, fromText, cd)
import Data.Conduit.Filesystem (sinkFile)
import Text.ProjectTemplate (createTemplate)
import Filesystem (createTree)
import Filesystem.Path (directory)
import Shelly (shellyNoDir, run_)
import Shared
main :: IO ()

41
yesod-scaffold.cabal

@ -0,0 +1,41 @@
name: yesod-scaffold
version: 0.1.0.0
synopsis: Yesod scaffolding tools
homepage: https://github.com/yesodweb/yesod-scaffold
license: MIT
license-file: LICENSE
author: Michael Snoyman
maintainer: michael@snoyman.com
category: Development
build-type: Simple
cabal-version: >=1.8
executable yesod-scaffold-build
main-is: build.hs
other-modules: Shared
build-depends: base >= 4 && < 5
, classy-prelude-conduit >= 0.4
, shelly >= 0.14
, project-template >= 0.1
, system-fileio >= 0.3
, system-filepath >= 0.4
executable yesod-scaffold-make-template
main-is: make-template.hs
other-modules: Shared
build-depends: base >= 4 && < 5
, classy-prelude-conduit >= 0.4
, shelly >= 0.14
, project-template >= 0.1
, system-fileio >= 0.3
, system-filepath >= 0.4
executable yesod-scaffold-merge
main-is: merge.hs
other-modules: Shared
build-depends: base >= 4 && < 5
, classy-prelude-conduit >= 0.4
, shelly >= 0.14
, project-template >= 0.1
, system-fileio >= 0.3
, system-filepath >= 0.4
Loading…
Cancel
Save