Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
smartcd: optimization/fix: make variables using fd/fdfind or `fin…
Browse files Browse the repository at this point in the history
…d` command local
  • Loading branch information
CodesOfRishi committed Dec 18, 2021
1 parent b0fca79 commit 09430d4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions smartcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ __smartcd__() {

# no. of unique recently visited directories smartcd to remember
export SMARTCD_HIST_SIZE=${SMARTCD_HIST_SIZE:-"50"}
export SMARTCD_VERSION="v1.4.0"
export SMARTCD_VERSION="v1.4.1"

# options customizations
export SMARTCD_CLEANUP_OPT=${SMARTCD_CLEANUP_OPT:-"--cleanup"} # option for cleanup of log file
Expand All @@ -28,13 +28,13 @@ __smartcd__() {

# arguments for find or fd/fdfind command
if [[ ${find_command} = *fdfind || ${find_command} = *fd ]]; then
find_sub_dir_cmd_args="${find_command} --hidden --exclude .git/ --type d -I"
find_parent_dir_cmd_args="${find_command} --exclude .git/ --search-path \${_path} -t d --max-depth=1 -H -I"
find_parent_dir_root_cmd_args="${find_command} --exclude .git/ --search-path / -t d --max-depth=1 -H -I"
local find_sub_dir_cmd_args="${find_command} --hidden --exclude .git/ --type d -I"
local find_parent_dir_cmd_args="${find_command} --exclude .git/ --search-path \${_path} -t d --max-depth=1 -H -I"
local find_parent_dir_root_cmd_args="${find_command} --exclude .git/ --search-path / -t d --max-depth=1 -H -I"
else
find_sub_dir_cmd_args="${find_command} . -type d ! -path '*/\.git/*' | grep -v '\.git$'"
find_parent_dir_cmd_args="${find_command} \${_path} -maxdepth 1 -type d ! -path '*/\.git/*'"
find_parent_dir_root_cmd_args="${find_command} / -maxdepth 1 -type d ! -path '*/\.git/*'"
local find_sub_dir_cmd_args="${find_command} . -type d ! -path '*/\.git/*' | grep -v '\.git$'"
local find_parent_dir_cmd_args="${find_command} \${_path} -maxdepth 1 -type d ! -path '*/\.git/*'"
local find_parent_dir_root_cmd_args="${find_command} / -maxdepth 1 -type d ! -path '*/\.git/*'"
fi

# ---------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 09430d4

Please sign in to comment.