Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save brightredchilli/658d26e379ef8e05ff8c63e72d0fadf7 to your computer and use it in GitHub Desktop.
Save brightredchilli/658d26e379ef8e05ff8c63e72d0fadf7 to your computer and use it in GitHub Desktop.

Revisions

  1. brightredchilli revised this gist Jun 7, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,3 @@
    # This strips the spaces as well. Could not combine the two sed expressions into 1. I think :alnum: and :space: is the problem. Look at -E
    heroku config --remote staging | grep -v "Config Vars" | sed 's/\([[:alnum:]_-]*\):/\1=/' | sed -E 's/[[:space:]]+//'
    # Use awk to remove spaces. strips the trailing ":" from the first column
    # adds quotes around the second.
    heroku config --remote staging | grep -v "Config Vars" | awk '{print substr($1, 1, length($1)-1)"=""\""$2"\""}' > .env.developmen
  2. brightredchilli revised this gist Jun 7, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    heroku config | grep -v "Config Vars" | sed 's/\([[:alnum:]_-]*\):/\1=/'
    # This strips the spaces as well. Could not combine the two sed expressions into 1. I think :alnum: and :space: is the problem. Look at -E
    heroku config --remote staging | grep -v "Config Vars" | sed 's/\([[:alnum:]_-]*\):/\1=/' | sed -E 's/[[:space:]]+//'
  3. brightredchilli created this gist Apr 27, 2018.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    heroku config | grep -v "Config Vars" | sed 's/\([[:alnum:]_-]*\):/\1=/'