File tree Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,29 @@ echo "random_string" > ~/.password_assume_role_encrypted
4848
4949## Settings when open terminal (I am using iterm)
5050```
51- mkdir -p /opt/lamhaison-tools && cd /opt/lamhaison-tools
51+ sudo mkdir -p /opt/lamhaison-tools
52+ chown $(whoami) /opt/lamhaison-tools
53+ cd /opt/lamhaison-tools
5254
55+ # If you using ~/.bashrc
5356# Install helpful-commandlines
54- git clone git@ github.com: lamhaison/helpful-commandlines.git
57+ git clone https:// github.com/ lamhaison/helpful-commandlines.git
5558echo "source /opt/lamhaison-tools/helpful-commandlines/main.sh" >> ~/.bashrc
5659
5760# Install aws-cli-utils commandlines
58- git clone https://github.com/lamhaison/helpful-commandlines .git
61+ git clone https://github.com/lamhaison/aws-cli-utils .git
5962echo "source /opt/lamhaison-tools/aws-cli-utils/main.sh" >> ~/.bashrc
63+
64+
65+ # If using zsh
66+ # Install helpful-commandlines
67+ git clone https://github.com/lamhaison/helpful-commandlines.git
68+ echo "source /opt/lamhaison-tools/helpful-commandlines/main.sh" >> ~/.zshrc
69+
70+ # Install aws-cli-utils commandlines
71+ git clone https://github.com/lamhaison/aws-cli-utils.git
72+ echo "source /opt/lamhaison-tools/aws-cli-utils/main.sh" >> ~/.zshrc
73+
6074```
6175
6276## Setting AWS credentials
Original file line number Diff line number Diff line change @@ -5,15 +5,23 @@ aws_history() {
55 local log_file_path=${aws_cli_logs} /${ASSUME_ROLE} .log
66 local peco_command=" cat ${log_file_path} | grep 'Running commandline ' | sed 's/Running commandline //' | uniq"
77 local peco_input=$( peco_create_menu " ${peco_command} " ' --prompt "Choose aws cli history >"' )
8- # Remove space
9- peco_input=${peco_input: 2}
10- # To cut ] in the end
11- peco_input=${peco_input% \] }
128
13- local BUFFER=$peco_input
14- CURSOR=$# BUFFER
9+ if [[ $? -ne 0 ]]; then
10+ return
11+ fi
12+
13+ if [ ! -z " $peco_input " ]; then
14+ # Remove space
15+ peco_input=${peco_input: 2}
16+ # To cut ] in the end
17+ peco_input=${peco_input% \] }
18+ local BUFFER=$peco_input
19+ CURSOR=$# BUFFER
20+
21+ fi
1522
1623}
24+
1725aws_help () {
1826 local aws_assume_role_main_function=" aws_assume_role_set_name_with_hint"
1927 local function_list=$(
You can’t perform that action at this time.
0 commit comments