소스 검색

Adds aws-profile script and alias

Tom McKenzie 5 년 전
부모
커밋
13eb200f6d
2개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  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