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
fe89d497
Commit
fe89d497
authored
Aug 28, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --prefix flag to ihaskell install
parent
6e82ef36
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
Main.hs
main/Main.hs
+2
-0
Flags.hs
src/IHaskell/Flags.hs
+6
-1
IPython.hs
src/IHaskell/IPython.hs
+5
-2
No files found.
main/Main.hs
View file @
fe89d497
...
...
@@ -100,6 +100,8 @@ parseKernelArgs = foldl' addFlag defaultKernelSpecOptions
kernelSpecOpts
{
kernelSpecDebug
=
True
}
addFlag
kernelSpecOpts
(
GhcLibDir
libdir
)
=
kernelSpecOpts
{
kernelSpecGhcLibdir
=
libdir
}
addFlag
kernelSpecOpts
(
KernelspecInstallPrefix
prefix
)
=
kernelSpecOpts
{
kernelSpecInstallPrefix
=
Just
prefix
}
addFlag
kernelSpecOpts
flag
=
error
$
"Unknown flag"
++
show
flag
-- | Run the IHaskell language kernel.
...
...
src/IHaskell/Flags.hs
View file @
fe89d497
...
...
@@ -37,6 +37,7 @@ data Argument = ConfFile String -- ^ A file with commands to load at startup
|
ConvertFromFormat
NotebookFormat
|
ConvertToFormat
NotebookFormat
|
ConvertLhsStyle
(
LhsStyle
String
)
|
KernelspecInstallPrefix
String
deriving
(
Eq
,
Show
)
data
LhsStyle
string
=
...
...
@@ -103,6 +104,10 @@ confFlag :: Flag Args
confFlag
=
flagReq
[
"conf"
,
"c"
]
(
store
ConfFile
)
"<rc.hs>"
"File with commands to execute at start; replaces ~/.ihaskell/rc.hs."
installPrefixFlag
::
Flag
Args
installPrefixFlag
=
flagReq
[
"prefix"
]
(
store
KernelspecInstallPrefix
)
"<install-dir>"
"Installation prefix for kernelspec (see Jupyter's --prefix option)"
helpFlag
=
flagHelpSimple
(
add
Help
)
add
flag
(
Args
mode
flags
)
=
Args
mode
$
flag
:
flags
...
...
@@ -113,7 +118,7 @@ store constructor str (Args mode prev) = Right $ Args mode $ constructor str : p
installKernelSpec
::
Mode
Args
installKernelSpec
=
mode
"install"
(
Args
InstallKernelSpec
[]
)
"Install the Jupyter kernelspec."
noArgs
[
ghcLibFlag
,
kernelDebugFlag
,
confFlag
,
helpFlag
]
[
ghcLibFlag
,
kernelDebugFlag
,
confFlag
,
installPrefixFlag
,
helpFlag
]
kernel
::
Mode
Args
kernel
=
mode
"kernel"
(
Args
(
Kernel
Nothing
)
[]
)
"Invoke the IHaskell kernel."
kernelArg
...
...
src/IHaskell/IPython.hs
View file @
fe89d497
...
...
@@ -46,6 +46,7 @@ data KernelSpecOptions =
{
kernelSpecGhcLibdir
::
String
-- ^ GHC libdir.
,
kernelSpecDebug
::
Bool
-- ^ Spew debugging output?
,
kernelSpecConfFile
::
IO
(
Maybe
String
)
-- ^ Filename of profile JSON file.
,
kernelSpecInstallPrefix
::
Maybe
String
}
defaultKernelSpecOptions
::
KernelSpecOptions
...
...
@@ -53,6 +54,7 @@ defaultKernelSpecOptions = KernelSpecOptions
{
kernelSpecGhcLibdir
=
GHC
.
Paths
.
libdir
,
kernelSpecDebug
=
False
,
kernelSpecConfFile
=
defaultConfFile
,
kernelSpecInstallPrefix
=
Nothing
}
-- | The IPython kernel name.
...
...
@@ -201,8 +203,9 @@ installKernelspec replace opts = void $ do
Just
ipython
<-
SH
.
which
"ipython"
let
replaceFlag
=
[
"--replace"
|
replace
]
cmd
=
[
"kernelspec"
,
"install"
,
"--user"
,
kernelDir
]
++
replaceFlag
SH
.
silently
$
SH
.
run
ipython
(
map
SH
.
toTextIgnore
cmd
)
installPrefixFlag
=
maybe
[]
(
\
prefix
->
[
"--prefix"
,
T
.
pack
prefix
])
(
kernelSpecInstallPrefix
opts
)
cmd
=
[
"kernelspec"
,
"install"
,
"--user"
,
SH
.
toTextIgnore
kernelDir
]
++
replaceFlag
++
installPrefixFlag
SH
.
silently
$
SH
.
run
ipython
cmd
kernelSpecCreated
::
SH
.
Sh
Bool
kernelSpecCreated
=
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