-
Notifications
You must be signed in to change notification settings - Fork 843
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
global -p option #542
Merged
Merged
global -p option #542
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
830ca3d
global -p option
ea103d6
Integration Test
be8dbb1
Better exception handling and dropped short option
55a5476
Also catch PathParseException
6ad5ee6
Merging master
545a490
Reflect renamed file in stack.cabal extra-source-files
DanBurton db49d0b
Reflect renamed file in stack.cabal extra-source-files
DanBurton 2b0f00e
global -p option
e055949
Integration Test
ebaca88
Better exception handling and dropped short option
064ce96
Also catch PathParseException
7b13209
Merge commit '064ce96' into userlocalbin
21db73f
Failed specified path throws ConfigParseException
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,6 +436,8 @@ data ConfigMonoid = | |
-- ^ See: 'configExtraLibDirs' | ||
,configMonoidConcurrentTests :: !(Maybe Bool) | ||
-- ^ See: 'configConcurrentTests' | ||
,configMonoidLocalBin :: !(Maybe FilePath) | ||
-- ^ Used to override the binary installation dir | ||
} | ||
deriving Show | ||
|
||
|
@@ -457,6 +459,7 @@ instance Monoid ConfigMonoid where | |
, configMonoidExtraIncludeDirs = Set.empty | ||
, configMonoidExtraLibDirs = Set.empty | ||
, configMonoidConcurrentTests = Nothing | ||
, configMonoidLocalBin = Nothing | ||
} | ||
mappend l r = ConfigMonoid | ||
{ configMonoidDockerOpts = configMonoidDockerOpts l <> configMonoidDockerOpts r | ||
|
@@ -476,6 +479,7 @@ instance Monoid ConfigMonoid where | |
, configMonoidExtraIncludeDirs = Set.union (configMonoidExtraIncludeDirs l) (configMonoidExtraIncludeDirs r) | ||
, configMonoidExtraLibDirs = Set.union (configMonoidExtraLibDirs l) (configMonoidExtraLibDirs r) | ||
, configMonoidConcurrentTests = configMonoidConcurrentTests l <|> configMonoidConcurrentTests r | ||
, configMonoidLocalBin = configMonoidLocalBin l <|> configMonoidLocalBin r | ||
} | ||
|
||
instance FromJSON ConfigMonoid where | ||
|
@@ -500,6 +504,7 @@ instance FromJSON ConfigMonoid where | |
configMonoidExtraIncludeDirs <- obj .:? "extra-include-dirs" .!= Set.empty | ||
configMonoidExtraLibDirs <- obj .:? "extra-lib-dirs" .!= Set.empty | ||
configMonoidConcurrentTests <- obj .:? "concurrent-tests" | ||
configMonoidLocalBin <- obj .:? "local-bin" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be |
||
return ConfigMonoid {..} | ||
|
||
-- | Newtype for non-orphan FromJSON instance. | ||
|
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,25 @@ | ||
import StackTest | ||
import System.Directory | ||
|
||
main :: IO () | ||
main = do | ||
-- install in relative path | ||
createDirectory "bin" | ||
stack ["-p", "./bin", "install" , "happy"] | ||
doesExist "./bin/happy" | ||
|
||
-- Default install | ||
-- This seems to fail due to direcory being cleaned up, | ||
-- a manual test of the default stack install is required | ||
-- defaultDir <- getAppUserDataDirectory "local" | ||
-- stack ["install", "happy"] | ||
-- doesExist (defaultDir ++ "/bin/happy") | ||
|
||
-- install in current dir | ||
stack ["-p", ".", "install", "happy" ] | ||
doesExist "happy" | ||
|
||
-- install in absolute path | ||
tmpDirectory <- getTemporaryDirectory | ||
stack ["-p", tmpDirectory, "install", "happy" ] | ||
doesExist "/tmp/happy" |
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.
Should not be using
error
, instead throw a new ConfigException constructor.