Remove placeholder functions. Add cdf() and quicklook()
This commit is contained in:
parent
3f8e3c28b3
commit
72196c4df0
31
zsh/lib/os
31
zsh/lib/os
|
@ -12,13 +12,21 @@ function is_linux {
|
||||||
|
|
||||||
if is_mac; then
|
if is_mac; then
|
||||||
|
|
||||||
|
# Change working directory to the top-most Finder window location
|
||||||
|
function cdf() { # short for `cdfinder`
|
||||||
|
cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Open a file in Mac OS's quick-look
|
||||||
|
function quicklook {
|
||||||
|
(( $# > 0 )) && qlmanage -p $* &>/dev/null &
|
||||||
|
}
|
||||||
|
|
||||||
# Check to see if the (mac) app exists
|
# Check to see if the (mac) app exists
|
||||||
function app_exists {
|
function app_exists {
|
||||||
[ -d /Applications/"$1" ] || [ -e /Applications/"$1".app ] || [ -e ~/Applications/"$1".app ]
|
[ -d /Applications/"$1" ] || [ -e /Applications/"$1".app ] || [ -e ~/Applications/"$1".app ]
|
||||||
}
|
}
|
||||||
|
|
||||||
if command_exists brew; then
|
|
||||||
|
|
||||||
function pkg_install() {
|
function pkg_install() {
|
||||||
brew install $1
|
brew install $1
|
||||||
}
|
}
|
||||||
|
@ -31,25 +39,6 @@ if is_mac; then
|
||||||
brew update && brew upgrade
|
brew update && brew upgrade
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
function pkg_install() {
|
|
||||||
echo_r "Homebrew not installed"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function pkg_remove() {
|
|
||||||
echo_r "Homebrew not installed"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function pkg_update() {
|
|
||||||
echo_r "Homebrew not installed"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif is_deb; then
|
elif is_deb; then
|
||||||
|
|
||||||
function pkg_install() {
|
function pkg_install() {
|
||||||
|
|
Loading…
Reference in a new issue