Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-ide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-ide
Commits
412ff028
Commit
412ff028
authored
Apr 11, 2019
by
Mart Lubbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement environment rename .. for cpm
parent
60a8b3a8
Pipeline
#21003
passed with stage
in 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
cpm/CpmLogic.icl
cpm/CpmLogic.icl
+22
-14
No files found.
cpm/CpmLogic.icl
View file @
412ff028
...
...
@@ -245,23 +245,13 @@ doProjectAction _ _ _ _ world =
*/
doEnvironmentAction
::
String
String
EnvironmentAction
*
World
->
*
World
doEnvironmentAction
cleanhome
pwd
ListEnvironments
world
#
(
envs
,
world
)
=
readIDEEnvs
cleanhome
EnvsFileName
world
=
showLines
[
t
.
target_name
\\
t
<-
envs
]
world
=
withEnvironments
cleanhome
(\
ts
w
->(
Nothing
,
showLines
[
t
.
target_name
\\
t
<-
ts
]
w
))
world
doEnvironmentAction
cleanhome
pwd
(
ImportEnvironment
ef
)
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
=
withEnvironment
cleanhome
en
(\_
w
->(
Just
[],
w
))
world
doEnvironmentAction
cleanhome
pwd
(
ShowEnvironment
en
)
world
#
(
envs
,
world
)
=
readIDEEnvs
cleanhome
EnvsFileName
world
#
match
=
filter
(\
s
->
s
.
target_name
==
en
)
envs
|
isEmpty
match
=
error
(
"Environment "
+++
en
+++
" not found"
)
world
=
showLines
(
printEnvironment
(
hd
match
))
world
=
withEnvironment
cleanhome
en
(\
e
w
->(
Nothing
,
showLines
(
printEnvironment
e
)
w
))
world
where
printEnvironment
e
=
[
"Name: "
+++
e
.
target_name
...
...
@@ -289,7 +279,8 @@ where
]
doEnvironmentAction
cleanhome
pwd
(
ExportEnvironment
en
)
world
=
error
(
"Not implemented"
)
world
doEnvironmentAction
cleanhome
pwd
(
CreateEnvironment
en
)
world
=
error
(
"Not implemented"
)
world
doEnvironmentAction
cleanhome
pwd
(
RenameEnvironment
en
en`
)
world
=
error
(
"Not implemented"
)
world
doEnvironmentAction
cleanhome
pwd
(
RenameEnvironment
en
en`
)
world
=
withEnvironment
cleanhome
en
(\
t
w
->(
Just
[{
t
&
target_name
=
en`
}],
w
))
world
doEnvironmentAction
cleanhome
pwd
(
SetEnvironmentCompiler
en
cp
)
world
=
error
(
"Not implemented"
)
world
doEnvironmentAction
cleanhome
pwd
(
SetEnvironmentCodeGen
en
cp
)
world
=
error
(
"Not implemented"
)
world
doEnvironmentAction
_
_
_
world
=
...
...
@@ -306,6 +297,23 @@ doEnvironmentAction _ _ _ world =
,
" setcodegen <envname> <codegenname> : set codegen for <envname> to <codegenname>"
]
world
withEnvironments
::
String
([
Target
]
*
World
->
(
Maybe
[
Target
],
*
World
))
*
World
->
*
World
withEnvironments
cleanhome
envf
world
#
(
envs
,
world
)
=
uncurry
envf
(
readIDEEnvs
cleanhome
EnvsFileName
world
)
|
isNothing
envs
=
world
#
(
ok
,
world
)
=
writeIDEEnvs
cleanhome
EnvsFileName
(
fromJust
envs
)
world
|
not
ok
=
error
(
"Error writing environment"
)
world
=
world
withEnvironment
::
String
String
(
Target
*
World
->
(
Maybe
[
Target
],
*
World
))
->
(*
World
->
*
World
)
withEnvironment
cleanhome
envname
envf
=
withEnvironments
cleanhome
\
ts
world
->
case
span
(\
s
->
s
.
target_name
<>
envname
)
ts
of
(_,
[])
=
(
Nothing
,
error
(
"Environment "
+++
envname
+++
" not found"
)
world
)
(
e
,
[
t
:
es
])
=
case
envf
t
world
of
(
Nothing
,
world
)
=
(
Nothing
,
world
)
(
Just
ts
,
world
)
=
(
Just
(
flatten
[
e
,
ts
,
es
]),
world
)
/**
* Modify a project
*/
...
...
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