-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 443-specify-path integration test on Windows
- Loading branch information
Showing
1 changed file
with
7 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
import StackTest | ||
import System.Directory | ||
import System.FilePath | ||
import System.Info (os) | ||
|
||
main :: IO () | ||
main = do | ||
let ext = if os == "mingw32" then ".exe" else "" | ||
|
||
-- install in relative path | ||
createDirectory "bin" | ||
stack ["--local-bin-path", "./bin", "install" , "happy"] | ||
doesExist "./bin/happy" | ||
doesExist ("./bin/happy" ++ ext) | ||
|
||
-- 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") | ||
-- doesExist (defaultDir ++ "/bin/happy" ++ ext) | ||
|
||
-- install in current dir | ||
stack ["--local-bin-path", ".", "install", "happy" ] | ||
doesExist "happy" | ||
doesExist ("happy" ++ ext) | ||
|
||
-- install in absolute path | ||
tmpDirectory <- fmap (</> "absolute-bin") getCurrentDirectory | ||
createDirectory tmpDirectory | ||
stack ["--local-bin-path", tmpDirectory, "install", "happy" ] | ||
doesExist (tmpDirectory </> "happy") | ||
doesExist (tmpDirectory </> ("happy" ++ ext)) |