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

Allow for array transforms in config file to be passed to CLI #216

Merged
merged 1 commit into from
Jun 1, 2017

Conversation

stephenjwatkins
Copy link
Contributor

@stephenjwatkins stephenjwatkins commented Jan 30, 2017

According to the docs (https://github.com/jkphl/svg-sprite/blob/master/docs/command-line.md), a config file that's generated from the online config generator can be passed to the CLI. However, passing it the file wasn't able to read the SVGO transform plugins. This is because the CLI tries to do special string processing on the transform configuration.

This PR passes through the shape.transform config unless it is a string.

Example config file that was unable to process the svgo plugins:

{
  "dest": "dist",
  "shape": {
    "transform": [
      {
        "svgo": {
          "plugins": [
            { "removeUnknownsAndDefaults"    : false}
          ]
        }
      }
    ]
  },
  "mode": {
    "symbol": {
      "dest": ".",
      "sprite": "ui.svg"
    }
  }
}

@stephenjwatkins stephenjwatkins changed the title Allow for array transforms to be passed through Allow for array transforms in config file to be passed to CLI Jan 30, 2017
@coveralls
Copy link

coveralls commented Jan 30, 2017

Coverage Status

Coverage remained the same at 79.606% when pulling 793f2a6 on stephenjwatkins:master into 98585f6 on jkphl:master.

@jkphl jkphl added the bug label May 30, 2017
@jkphl jkphl added this to the 1.3.x milestone May 30, 2017
@jkphl jkphl merged commit 793f2a6 into svg-sprite:master Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants