Explorar el Código

Adds aws-profile script and alias

Tom McKenzie hace 5 años
padre
commit
13eb200f6d
Se han modificado 2 ficheros con 12 adiciones y 0 borrados
  1. 3 0
      .rc.d/aliases.sh
  2. 9 0
      bin/aws-profile

+ 3 - 0
.rc.d/aliases.sh

@@ -17,5 +17,8 @@ if [[ "$(uname -s)" = 'Darwin' ]]; then
   alias chrome-tabs="$HOME/dotfiles/bin/chrome-tabs"
 fi
 
+# other bin
+alias awsp="$HOME/dotfiles/bin/aws-profile"
+
 # display docker statuses
 alias dockerps="docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'"

+ 9 - 0
bin/aws-profile

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [ -z $1 ]; then
+    echo "Available AWS Profiles:"
+    grep -E '^\[(.+)\]$' ~/.aws/credentials | sed 's/[][]//g'
+else
+    export AWS_DEFAULT_PROFILE=$1
+    echo "AWS Profile set to $1"
+fi