Skip to content

maltmill new generates invalid formula when repo description contains a single quote #45

@jackchuka

Description

@jackchuka

Summary

When a GitHub repo description includes a single quote ('), maltmill new renders the Homebrew formula with desc '...' and produces an invalid string.

Steps to reproduce

  1. Use a repo with a description containing a single quote, e.g. "A CLI that's fast".
  2. Run maltmill new <owner>/<repo>.
  3. Inspect the generated formula.

Actual behavior

The formula contains:

desc 'A CLI that's fast'

This breaks the Ruby string and the formula is invalid.

Expected behavior

desc should be escaped so the formula is valid:

desc 'A CLI that\'s fast'

Environment

  • maltmill version: 1.2.0
  • OS: Mac

Suggested fix

Escape single quotes (and backslashes) in the description before rendering the template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions