1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-29 06:40:08 +00:00

only call dropbox-cli if it exists

This commit is contained in:
romkatv 2019-05-22 20:03:30 +02:00
parent 7ca1d950f1
commit a49dc626f3

View file

@ -2074,8 +2074,9 @@ prompt_kubecontext() {
################################################################ ################################################################
# Dropbox status # Dropbox status
prompt_dropbox() { prompt_dropbox() {
(( $+commands[dropbox-cli] )) || return
# The first column is just the directory, so cut it # The first column is just the directory, so cut it
local dropbox_status="$(dropbox-cli filestatus . | cut -d\ -f2-)" local dropbox_status="$(command dropbox-cli filestatus . | cut -d\ -f2-)"
# Only show if the folder is tracked and dropbox is running # Only show if the folder is tracked and dropbox is running
if [[ "$dropbox_status" != 'unwatched' && "$dropbox_status" != "isn't running!" ]]; then if [[ "$dropbox_status" != 'unwatched' && "$dropbox_status" != "isn't running!" ]]; then