Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
f4b7fb59
Commit
f4b7fb59
authored
Aug 26, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow using ihaskell without stack...
parent
716d8a6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Main.hs
main/Main.hs
+7
-3
No files found.
main/Main.hs
View file @
f4b7fb59
...
@@ -18,6 +18,7 @@ import Data.Aeson
...
@@ -18,6 +18,7 @@ import Data.Aeson
import
System.Directory
import
System.Directory
import
System.Process
(
readProcess
,
readProcessWithExitCode
)
import
System.Process
(
readProcess
,
readProcessWithExitCode
)
import
System.Exit
(
exitSuccess
,
ExitCode
(
ExitSuccess
))
import
System.Exit
(
exitSuccess
,
ExitCode
(
ExitSuccess
))
import
Control.Exception
(
try
,
SomeException
)
import
System.Environment
(
getArgs
)
import
System.Environment
(
getArgs
)
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
import
System.Environment
(
setEnv
)
import
System.Environment
(
setEnv
)
...
@@ -116,11 +117,14 @@ runKernel kernelOpts profileSrc = do
...
@@ -116,11 +117,14 @@ runKernel kernelOpts profileSrc = do
dir
<-
getIHaskellDir
dir
<-
getIHaskellDir
Stdin
.
recordKernelProfile
dir
profile
Stdin
.
recordKernelProfile
dir
profile
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
-- Detect if we have stack
-- Detect if we have stack
(
exitCode
,
stackStdout
,
_
)
<-
readProcessWithExitCode
"stack"
[]
""
runResult
<-
try
$
readProcessWithExitCode
"stack"
[]
""
let
stack
=
exitCode
==
ExitSuccess
&&
"The Haskell Tool Stack"
`
isInfixOf
`
stackStdout
let
stack
=
case
runResult
::
Either
SomeException
(
ExitCode
,
String
,
String
)
of
Left
_
->
False
Right
(
exitCode
,
stackStdout
,
_
)
->
exitCode
==
ExitSuccess
&&
"The Haskell Tool Stack"
`
isInfixOf
`
stackStdout
#
if
MIN_VERSION_ghc
(
7
,
8
,
0
)
-- If we're in a stack directory, use `stack` to set the environment
-- If we're in a stack directory, use `stack` to set the environment
-- We can't do this with base <= 4.6 because setEnv doesn't exist.
-- We can't do this with base <= 4.6 because setEnv doesn't exist.
when
stack
$
do
when
stack
$
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment