Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve multilines commands formatting in JSON object #4339

Closed
slemeur opened this issue Mar 7, 2017 · 0 comments
Closed

Improve multilines commands formatting in JSON object #4339

slemeur opened this issue Mar 7, 2017 · 0 comments
Labels
kind/enhancement A feature request - must adhere to the feature request template.

Comments

@slemeur
Copy link
Contributor

slemeur commented Mar 7, 2017

Goals

Improve the CommandsJSON Object to better handle multilines commands.

Details

Before intelligent commands, we were handling multilines (or multi-instructions) commands by combining them using && characters. So a command was looking like this:

{
          "name": "build and deploy",
          "type": "mvn",
          "commandLine": "mvn -f ${current.project.path} clean install -DskipTests && cp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war && $TOMCAT_HOME/bin/catalina.sh run 2>&1",
          "attributes": {
            "previewUrl": "http://${server.port.8080}"
          }
}

With the introduction of the new command's editor, we are now allowing multiple lines in command's definition. In order to do that, we have to replace && by \n. But the way we are handling it into the JSON object is making the command hard to read.

{
          "name": "build and deploy",
          "type": "mvn",
          "commandLine": "mvn -f ${current.project.path} clean install -DskipTests \ncp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war \n$TOMCAT_HOME/bin/catalina.sh run 2>&1",
          "attributes": {
            "previewUrl": "http://${server.port.8080}",
            "goal": "Run"
          }
}

We need to improve the representation of the Command JSON object so that it will stay readable and better formatted.
The proposal would be the following:

{
          "name": "build and deploy",
          "type": "mvn",
          "commandLine": [
                  "mvn -f ${current.project.path} clean install -DskipTests",
                  "cp ${current.project.path}/target/*.war $TOMCAT_HOME/webapps/ROOT.war", 
                  "$TOMCAT_HOME/bin/catalina.sh run 2>&1"
          ],
          "attributes": {
            "previewUrl": "http://${server.port.8080}",
            "goal": "Run"
          }
}

Linked issues:

#4274

@slemeur slemeur added the kind/task Internal things, technical debt, and to-do tasks to be performed. label Mar 7, 2017
@TylerJewell TylerJewell added kind/enhancement A feature request - must adhere to the feature request template. and removed kind/task Internal things, technical debt, and to-do tasks to be performed. labels Apr 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

No branches or pull requests

2 participants