Created
February 13, 2020 07:57
-
-
Save GennadySpb/c5a26fa808e9d9dbb25e4321d4ec980d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create URL friendly name from arbitrary string, cut length to 63 chars | |
# like CI_COMMIT_REF_SLUG in Gitlab | |
slugify() { | |
echo -n "$1" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z | cut -c -63 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment