Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-ide
Commits
60a8b3a8
Commit
60a8b3a8
authored
Apr 10, 2019
by
Mart Lubbers
Browse files
implement environment remove <environment> for cpm
parent
99a5e610
Pipeline
#20930
passed with stage
in 1 minute
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cpm/CpmLogic.icl
View file @
60a8b3a8
...
...
@@ -248,8 +248,15 @@ doEnvironmentAction cleanhome pwd ListEnvironments world
#
(
envs
,
world
)
=
readIDEEnvs
cleanhome
EnvsFileName
world
=
showLines
[
t
.
target_name
\\
t
<-
envs
]
world
doEnvironmentAction
cleanhome
pwd
(
ImportEnvironment
ef
)
world
=
error
(
"Not implemented"
)
world
doEnvironmentAction
cleanhome
pwd
(
RemoveEnvironment
en
)
world
=
error
(
"Not implemented"
)
world
=
error
"Not implemented"
world
doEnvironmentAction
cleanhome
pwd
(
RemoveEnvironment
en
)
world
#
(
envs
,
world
)
=
readIDEEnvs
cleanhome
EnvsFileName
world
=
case
span
(\
s
->
s
.
target_name
<>
en
)
envs
of
(_,
[])
=
error
(
"Environment "
+++
en
+++
" not found"
)
world
(
e
,
[_:
es
])
#
(
ok
,
world
)
=
writeIDEEnvs
cleanhome
EnvsFileName
[
t
\\
t
<-
envs
|
t
.
target_name
<>
en
]
world
|
not
ok
=
error
(
"Error writing environmint"
)
world
=
world
doEnvironmentAction
cleanhome
pwd
(
ShowEnvironment
en
)
world
#
(
envs
,
world
)
=
readIDEEnvs
cleanhome
EnvsFileName
world
#
match
=
filter
(\
s
->
s
.
target_name
==
en
)
envs
...
...
cpm/
Posix/
CpmPaths.dcl
→
cpm/CpmPaths.dcl
View file @
60a8b3a8
...
...
@@ -3,4 +3,4 @@ definition module CpmPaths
import
PmEnvironment
readIDEEnvs
::
!
String
!
String
!*
World
->
*([
Target
],
*
World
)
writeIDEEnvs
::
!
String
!
String
![
Target
]
!*
World
->
*(
Bool
,
*
World
)
cpm/
Posix/
CpmPaths.icl
→
cpm/CpmPaths.icl
View file @
60a8b3a8
...
...
@@ -11,3 +11,7 @@ append_dir_separator s
readIDEEnvs
::
!
String
!
String
!*
World
->
*([
Target
],
*
World
)
readIDEEnvs
cleanhome
ideenvs
world
=
openEnvironments
cleanhome
(
append_dir_separator
cleanhome
+++
"etc"
+++
DirSeparatorString
+++
ideenvs
)
world
writeIDEEnvs
::
!
String
!
String
![
Target
]
!*
World
->
*(
Bool
,
*
World
)
writeIDEEnvs
cleanhome
ideenvs
envs
world
=
saveEnvironments
(
append_dir_separator
cleanhome
+++
"etc"
+++
DirSeparatorString
+++
ideenvs
)
envs
world
cpm/Windows/CpmPaths.dcl
deleted
100644 → 0
View file @
99a5e610
definition
module
CpmPaths
import
PmEnvironment
readIDEEnvs
::
!
String
!
String
!*
World
->
*([
Target
],
*
World
)
cpm/Windows/CpmPaths.icl
deleted
100644 → 0
View file @
99a5e610
implementation
module
CpmPaths
import
StdEnv
,
Platform
,
PmEnvironment
append_dir_separator
::
!{#
Char
}
->
{#
Char
}
append_dir_separator
s
|
size
s
>
0
&&
s
.[
size
s
-1
]==
DirSeparator
=
s
=
s
+++
DirSeparatorString
readIDEEnvs
::
!
String
!
String
!*
World
->
*([
Target
],
*
World
)
readIDEEnvs
cleanhome
ideenvs
world
=
openEnvironments
cleanhome
(
append_dir_separator
cleanhome
+++
"Config"
+++
DirSeparatorString
+++
ideenvs
)
world
Write
Preview
Supports
Markdown
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