-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make stack clean be more thorough by default #4385
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cb1f824
Implemented stack purge
vanceism7 d4d7352
Updated comment for clean shallow. (No fix was needed)
vanceism7 bac2fcf
Updated docs for stack clean
vanceism7 caa2b9b
Updated help messages for stack clean and purge
vanceism7 23d534d
fix docs wording
dbaynard 854593b
fixed wording
mattaudesse dad8f92
Clarify differences between clean and purge
dbaynard ccba7f2
Improve description of --full
dbaynard 9ccfdab
Clarify clean and purge help text
dbaynard 97f280b
Added stack purge integration test
vanceism7 893a8b7
Check correct directory deletion behaviour for simple project
dbaynard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import StackTest | ||
import Data.Maybe (listToMaybe, fromMaybe) | ||
import System.Directory | ||
import System.FilePath | ||
|
||
main :: IO () | ||
main = | ||
-- For these commands, we'll need to know the `dist` directory. | ||
-- This is usually `.stack-work/dist/$compiler-variant/Cabal-xxxx` | ||
stackCheckStdout [defaultResolverArg, "path", "--dist-dir"] $ \distDir -> | ||
|
||
stackCheckStdout [defaultResolverArg, "path", "--local-install-root"] $ \localInstallRoot -> do | ||
|
||
-- Usually `.stack-work` | ||
let stackWork = fromMaybe (error "There must be a stack working directory.") $ | ||
listToMaybe (splitDirectories distDir) | ||
|
||
-- First, clean the .stack-work directory. | ||
-- This is only necessary when running individual tests. | ||
stack [defaultResolverArg, "purge"] | ||
doesNotExist stackWork | ||
|
||
-- The dist directory should exist after a build | ||
stack [defaultResolverArg, "build"] | ||
doesExist distDir | ||
doesExist localInstallRoot | ||
doesExist stackWork | ||
|
||
-- The dist directory should not exist after a clean, whereas the | ||
-- .stack-work directory should | ||
stack [defaultResolverArg, "clean"] | ||
run "exa" ["-T", ".stack-work"] | ||
doesNotExist distDir | ||
doesExist localInstallRoot | ||
doesExist stackWork | ||
|
||
-- The .stack-work directory should not exist after a purge | ||
stack [defaultResolverArg, "purge"] | ||
doesNotExist stackWork |
11 changes: 11 additions & 0 deletions
11
test/integration/tests/3863-purge-command/files/new-template.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: new-template | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
|
||
library | ||
hs-source-dirs: src | ||
exposed-modules: Lib | ||
build-depends: base >= 4.7 && < 5 | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Lib where | ||
|
||
someFunc :: () | ||
someFunc = () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
flags: {} | ||
packages: | ||
- '.' | ||
extra-deps: [] | ||
resolver: lts-11.22 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😀