File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ Behavior changes:
1111
1212Other enhancements:
1313
14+ * ` stack unpack ` now supports a ` --to /target/directory ` option to
15+ specify where to unpack the package into
16+
1417Bug fixes:
1518* When a package contained sublibraries, stack was always recompiling the
1619 package. This has been fixed now, no recompilation is being done because of
Original file line number Diff line number Diff line change @@ -517,6 +517,13 @@ Unpacked yackage-0.8.0 to /var/home/harendra/yackage-0.8.0/
517517cueball:~$ cd yackage-0.8.0/
518518` ` `
519519
520+ Note that you can also unpack to the directory of your liking instead of
521+ the current one by issueing :
522+
523+ ` ` `
524+ cueball:~$ stack unpack yackage-0.8.0 --to ~/work
525+ ` ` `
526+
520527# ## stack init
521528This new directory does not have a `stack.yaml` file, so we need to make one
522529first. We could do it by hand, but let's be lazy instead with the `stack init`
@@ -1715,7 +1722,8 @@ users. Here's a quick rundown:
17151722 upstream packages available).
17161723* `stack unpack` is a command we've already used quite a bit for examples, but
17171724 most users won't use it regularly. It does what you'd expect : downloads a
1718- tarball and unpacks it.
1725+ tarball and unpacks it. It accept optional `--to` argument to specify
1726+ the destination directory.
17191727* `stack sdist` generates an uploading tarball containing your package code
17201728* `stack upload` uploads an sdist to Hackage. As of
17211729 version [1.1.0](https://docs.haskellstack.org/en/v1.1.0/ChangeLog/) stack
Original file line number Diff line number Diff line change @@ -305,7 +305,9 @@ commandLineHandler currentDir progName isInterpreter = complicatedOptions
305305 addCommand' " unpack"
306306 " Unpack one or more packages locally"
307307 unpackCmd
308- (some $ strArgument $ metavar " PACKAGE" )
308+ ((,) <$> some (strArgument $ metavar " PACKAGE" )
309+ <*> optional (textOption $ long " to" <>
310+ help " Optional path to unpack the package into" ))
309311 addCommand' " update"
310312 " Update the package index"
311313 updateCmd
@@ -650,10 +652,11 @@ uninstallCmd _ go = withConfigAndLock go $
650652 ]
651653
652654-- | Unpack packages to the filesystem
653- unpackCmd :: [String ] -> GlobalOpts -> IO ()
654- unpackCmd names go = withConfigAndLock go $ do
655+ unpackCmd :: ([String ], Maybe Text ) -> GlobalOpts -> IO ()
656+ unpackCmd (names, Nothing ) go = unpackCmd (names, Just " ." ) go
657+ unpackCmd (names, Just dstPath) go = withConfigAndLock go $ do
655658 mSnapshotDef <- mapM (makeConcreteResolver Nothing >=> loadResolver) (globalResolver go)
656- Stack.Fetch. unpackPackages mSnapshotDef " . " names
659+ Stack.Fetch. unpackPackages mSnapshotDef ( T. unpack dstPath) names
657660
658661-- | Update the package index
659662updateCmd :: () -> GlobalOpts -> IO ()
You can’t perform that action at this time.
0 commit comments