Skip to content

Instantly share code, notes, and snippets.

@onuralp
Last active May 22, 2017 09:52

Revisions

  1. onuralp revised this gist May 22, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion marvel-ch.sh
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,9 @@ set -e
    # Gets a marvel-charecter slug

    NAME=$(marvel-characters)
    echo "$NAME" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z

    # For MacOS
    echo "$NAME" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z

    # For other OS
    # echo "$NAME" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
  2. onuralp created this gist May 22, 2017.
    7 changes: 7 additions & 0 deletions marvel-ch.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/bin/bash
    set -e

    # Gets a marvel-charecter slug

    NAME=$(marvel-characters)
    echo "$NAME" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z
    11 changes: 11 additions & 0 deletions setup-marvel-characters.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash
    set -e

    # If you don't like release-names that's helm auto-generated. You are not alone.
    # This trick let us to use marvel-character names instead of helm release names

    npm install -g marvel-characters

    # Resources:
    # https://gist.github.com/oneohthree/f528c7ae1e701ad990e6
    # https://github.com/mattdesl/marvel-characters