Browse Source

Adds aws-profile script and alias

Tom McKenzie 5 năm trước cách đây
mục cha
commit
13eb200f6d
2 tập tin đã thay đổi với 12 bổ sung0 xóa
  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