projects
/
selector.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Restore the umask when we modify it.
[selector.git]
/
bash-selector.sh
diff --git
a/bash-selector.sh
b/bash-selector.sh
index
6706c04
..
9d0355f
100755
(executable)
--- a/
bash-selector.sh
+++ b/
bash-selector.sh
@@
-61,6
+61,7
@@
export SELECTOR_CD_HISTORY_SIZE
# The function to use in place of the standard "cd"
function selector-cd () {
# The function to use in place of the standard "cd"
function selector-cd () {
+ UMASK=$(umask)
umask 077
if [[ -z "$1" ]]; then
umask 077
if [[ -z "$1" ]]; then
@@
-77,9
+78,11
@@
function selector-cd () {
fi
echo "${PWD}" | sed -e "s!^${HOME}!~!" >> "${SELECTOR_CD_HISTORY}"
fi
echo "${PWD}" | sed -e "s!^${HOME}!~!" >> "${SELECTOR_CD_HISTORY}"
+ umask ${UMASK}
}
function selector-cd-search () {
}
function selector-cd-search () {
+ UMASK=$(umask)
umask 077
if [[ -f "${SELECTOR_CD_HISTORY}" ]]; then
umask 077
if [[ -f "${SELECTOR_CD_HISTORY}" ]]; then
@@
-93,6
+96,7
@@
function selector-cd-search () {
else
echo "No cd history file '${SELECTOR_CD_HISTORY}'." >&2
fi
else
echo "No cd history file '${SELECTOR_CD_HISTORY}'." >&2
fi
+ umask ${UMASK}
}
alias cd=selector-cd
}
alias cd=selector-cd