Skip to content
Browse files

Minor tweaks based on usage

  • Loading branch information...
1 parent 01c30fa commit 8d2d61bc26f76c62fd83940905c098271a3b13a0 @snoyberg snoyberg committed Nov 28, 2011
Showing with 15 additions and 3 deletions.
  1. +6 −0 README.md
  2. +5 −3 cabal-src-install.hs
  3. +4 −0 cabal-src.cabal
View
6 README.md
@@ -50,3 +50,9 @@ automatically.
This software should be considered alpha. We'll likely be using it for all
Yesod development going forward, so I expect that alpha to be upgraded to beta
and finally production quality in short order. All feedback is welcome!
+
+## Usage
+
+Simply replace a call to "cabal install" with a call to "cabal-src-install".
+If you would like to only install the source tarball without actually
+installing the binary package, run it with "cabal-src-install --src-only".
View
8 cabal-src-install.hs
@@ -19,10 +19,12 @@ rawSystem' a b = do
main :: IO ()
main = do
args <- getArgs
- rawSystem' "cabal" $ "install" : args
+ unless (args == ["--src-only"]) $ rawSystem' "cabal" $ "install" : args
putStrLn "Installing source package"
- getDirectoryContents "dist" >>= mapM_ (\fp ->
- when (".tar.gz" `isSuffixOf` fp) $ removeFile $ "dist/" ++ fp)
+ distExists <- doesDirectoryExist "dist"
+ when distExists $
+ getDirectoryContents "dist" >>= mapM_ (\fp ->
+ when (".tar.gz" `isSuffixOf` fp) $ removeFile $ "dist/" ++ fp)
rawSystem' "cabal" ["sdist"]
files <- getDirectoryContents "dist"
case filter (".tar.gz" `isSuffixOf`) files of
View
4 cabal-src.cabal
@@ -19,3 +19,7 @@ Executable cabal-src-install
, tar
, directory
, process
+
+source-repository head
+ type: git
+ location: git://github.com/yesodweb/cabal-src.git

0 comments on commit 8d2d61b

Please sign in to comment.
Something went wrong with that request. Please try again.