File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,13 @@ case $- in
2121 * i* ) export BASH_IS_INTERACTIVE=" 1" ;;
2222esac
2323# #Is Passwordless?
24- if sudo -n true 2> /dev/null; then
25- export PASSWORDLESS_SUDO=" 1"
26- else
27- export PASSWORDLESS_SUDO=" 0"
24+ if command -v sudo & > /dev/null; then
25+ export SUDO_CMD_PREFIX=" sudo"
26+ if sudo -n true 2> /dev/null; then
27+ export PASSWORDLESS_SUDO=" 1"
28+ else
29+ export PASSWORDLESS_SUDO=" 0"
30+ fi
2831fi
2932# #Has curl
3033if ! command -v curl & > /dev/null; then
@@ -155,6 +158,7 @@ alias clean_buildenv='unset AR AS CC CFLAGS CPP CXX CPPFLAGS CXXFLAGS DLLTOOL HO
155158alias dir=' dir --color=auto'
156159alias docker_purge=' docker stop $(docker ps -aq) && docker rm $(docker ps -aq) && docker rmi $(docker images -q) -f'
157160alias du_dir=' du -h --max-depth=1 | sort -h'
161+ alias edit_bashrc=' eval "${SUDO_CMD_PREFIX}" "${EDITOR}" "$(realpath "${HOME}/.bashrc" | tr -d "[:space:]")"'
158162alias esort=' find "." -maxdepth 1 -type f -exec sort -u "{}" -o "{}" \;'
159163alias egrep=' egrep --color=auto'
160164alias fdfind=' fd'
You can’t perform that action at this time.
0 commit comments