Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,29 @@ echo "random_string" > ~/.password_assume_role_encrypted

## Settings when open terminal (I am using iterm)
```
mkdir -p /opt/lamhaison-tools && cd /opt/lamhaison-tools
sudo mkdir -p /opt/lamhaison-tools
chown $(whoami) /opt/lamhaison-tools
cd /opt/lamhaison-tools

# If you using ~/.bashrc
# Install helpful-commandlines
git clone git@github.com:lamhaison/helpful-commandlines.git
git clone https://github.com/lamhaison/helpful-commandlines.git
echo "source /opt/lamhaison-tools/helpful-commandlines/main.sh" >> ~/.bashrc

# Install aws-cli-utils commandlines
git clone https://github.com/lamhaison/helpful-commandlines.git
git clone https://github.com/lamhaison/aws-cli-utils.git
echo "source /opt/lamhaison-tools/aws-cli-utils/main.sh" >> ~/.bashrc


# If using zsh
# Install helpful-commandlines
git clone https://github.com/lamhaison/helpful-commandlines.git
echo "source /opt/lamhaison-tools/helpful-commandlines/main.sh" >> ~/.zshrc

# Install aws-cli-utils commandlines
git clone https://github.com/lamhaison/aws-cli-utils.git
echo "source /opt/lamhaison-tools/aws-cli-utils/main.sh" >> ~/.zshrc

```

## Setting AWS credentials
Expand Down
20 changes: 14 additions & 6 deletions services/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ aws_history() {
local log_file_path=${aws_cli_logs}/${ASSUME_ROLE}.log
local peco_command="cat ${log_file_path} | grep 'Running commandline ' | sed 's/Running commandline //' | uniq"
local peco_input=$(peco_create_menu "${peco_command}" '--prompt "Choose aws cli history >"')
# Remove space
peco_input=${peco_input:2}
# To cut ] in the end
peco_input=${peco_input%\]}

local BUFFER=$peco_input
CURSOR=$#BUFFER
if [[ $? -ne 0 ]]; then
return
fi

if [ ! -z "$peco_input" ]; then
# Remove space
peco_input=${peco_input:2}
# To cut ] in the end
peco_input=${peco_input%\]}
local BUFFER=$peco_input
CURSOR=$#BUFFER

fi

}

aws_help() {
local aws_assume_role_main_function="aws_assume_role_set_name_with_hint"
local function_list=$(
Expand Down