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
caa67f62
Commit
caa67f62
authored
Oct 27, 2013
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing IHaskell path resolution for 'IHaskell setup'.
parent
56bbd249
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
11 deletions
+25
-11
IPython.hs
IHaskell/IPython.hs
+25
-11
No files found.
IHaskell/IPython.hs
View file @
caa67f62
...
@@ -57,8 +57,8 @@ setupIPythonProfile profile = shelly $ do
...
@@ -57,8 +57,8 @@ setupIPythonProfile profile = shelly $ do
let
profileDir
=
ipythonDir
++
"/profile_"
++
pack
profile
++
"/"
let
profileDir
=
ipythonDir
++
"/profile_"
++
pack
profile
++
"/"
path
<-
liftIO
$
fmap
FS
.
encodeString
getArgv0Absolute
path
<-
getIHaskellPath
writeConfigFilesTo
profileDir
(
trace
path
$
path
)
writeConfigFilesTo
profileDir
path
-- | Write IPython configuration files to the profile directory.
-- | Write IPython configuration files to the profile directory.
writeConfigFilesTo
::
Text
-- ^ Profile directory to write to. Must have a trailing slash.
writeConfigFilesTo
::
Text
-- ^ Profile directory to write to. Must have a trailing slash.
...
@@ -78,12 +78,26 @@ writeConfigFilesTo profileDir ihaskellPath = writeFile (fromText configFile) con
...
@@ -78,12 +78,26 @@ writeConfigFilesTo profileDir ihaskellPath = writeFile (fromText configFile) con
]
]
getArgv0Absolute
::
IO
FS
.
FilePath
-- | Get the absolute path. If this is using path reso
getArgv0Absolute
=
do
getIHaskellPath
::
Sh
String
f
<-
getArgv0
getIHaskellPath
=
do
f'
<-
if
FS
.
absolute
f
then
return
f
-- Get the absolute filepath to the argument.
else
do
f
<-
liftIO
getArgv0
cd
<-
getCurrentDirectory
return
$
FS
.
decodeString
cd
FS
.</>
f
-- If we have an absolute path, that's the IHaskell we're interested in.
print
(
"FS:"
++
FS
.
encodeString
f'
)
if
FS
.
absolute
f
return
f'
then
return
$
FS
.
encodeString
f
else
-- Check whether this is a relative path, or just 'IHaskell' with $PATH
-- resolution done by the shell. If it's just 'IHaskell', use the $PATH
-- variable to find where IHaskell lives.
if
FS
.
filename
f
==
f
then
do
ihaskellPath
<-
which
"IHaskell"
case
ihaskellPath
of
Nothing
->
error
"IHaskell not on $PATH and not referenced relative to directory."
Just
path
->
return
$
FS
.
encodeString
path
else
do
-- If it's actually a relative path, make it absolute.
cd
<-
liftIO
getCurrentDirectory
return
$
FS
.
encodeString
$
FS
.
decodeString
cd
FS
.</>
f
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