sasjs / cli

Command line interface for creating, compiling, and building SAS® projects
https://cli.sasjs.io
MIT License
37 stars 5 forks source link

sasjs add should not add empty config #1151

Closed allanbowe closed 2 years ago

allanbowe commented 2 years ago

Currently when running sasjs add a config gets created with a bunch of empty attributes. To reproduce:

sasjs create demo -t jobs
cd demo
sasjs add # add dummy, local, sas9 target 

Now, the following target has been added:

    {
      "name": "sas9",
      "serverUrl": "https://some.server",
      "serverType": "SAS9",
      "appLoc": "/Public/app/sas9",
      "macroFolders": [],
      "programFolders": [],
      "binaryFolders": [],
      "buildConfig": {
        "initProgram": "",
        "termProgram": "",
        "buildOutputFileName": "sas9.sas",
        "buildOutputFolder": "sasjsbuild",
        "buildResultsFolder": "sasjsresults",
        "macroVars": {}
      },
      "jobConfig": {
        "jobFolders": [],
        "initProgram": "",
        "termProgram": "",
        "macroVars": {}
      },
      "serviceConfig": {
        "serviceFolders": [],
        "initProgram": "",
        "termProgram": "",
        "macroVars": {}
      },
      "streamConfig": {
        "streamWebFolder": "",
        "streamWeb": false,
        "webSourcePath": "",
        "streamServiceName": "",
        "assetPaths": []
      },
      "deployConfig": {
        "deployScripts": [],
        "deployServicePack": false
      },
      "testConfig": {
        "initProgram": "",
        "termProgram": "",
        "macroVars": {},
        "testSetUp": "",
        "testTearDown": ""
      },
      "serverName": "SASApp",
      "repositoryName": "Foundation"
    }

This is a problem, because these empty attributes will override any root-level attributes. Instead, the deployed config should look like this:

    {
      "name": "sas9",
      "serverUrl": "https://some.server",
      "serverType": "SAS9",
      "appLoc": "/Public/app/sas9",
      "deployConfig": {
        "deployServicePack": true
      },
      "serverName": "SASApp",
      "repositoryName": "Foundation"
    }

If we can make deployServicePack to be true by default, then we can also remove deployConfig.

ghost commented 2 years ago

:tada: This issue has been resolved in version 3.12.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: