mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2025-09-01 20:16:59 +00:00
23
strategies/irb_default_strategy.sh
Executable file
23
strategies/irb_default_strategy.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# "irb default strategy"
|
||||
#
|
||||
# Example irb process with junk variables:
|
||||
# irb RBENV_VERSION=1.9.3-p429 GREP_COLOR=34;47 TERM_PROGRAM=Apple_Terminal
|
||||
#
|
||||
# When executed, the above will fail. This strategy handles that.
|
||||
|
||||
ORIGINAL_COMMAND="$1"
|
||||
DIRECTORY="$2"
|
||||
|
||||
original_command_wo_junk_vars() {
|
||||
echo "$ORIGINAL_COMMAND" |
|
||||
sed 's/RBENV_VERSION[^ ]*//' |
|
||||
sed 's/GREP_COLOR[^ ]*//' |
|
||||
sed 's/TERM_PROGRAM[^ ]*//'
|
||||
}
|
||||
|
||||
main() {
|
||||
echo "$(original_command_wo_junk_vars)"
|
||||
}
|
||||
main
|
Reference in New Issue
Block a user