Skip to content

Commit

Permalink
abspath before keepit import
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Deeb-Swihart committed Jan 18, 2019
1 parent ded228a commit e67d33e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 71 deletions.
18 changes: 10 additions & 8 deletions bin/watchman-process-files.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def process_file(rules, variables, path: str):
if not os.path.exists('/usr/local/bin/tag'):
raise RuntimeError("Please run `brew install tag'")
check_output(['/usr/local/bin/tag', '--add', ','.join(tags), new_name])
return add_tmpl.format(name=new_name, fldr=fldr, tags=', '.join(f'"{t}"' for t in tags))
return add_tmpl.format(name=os.path.abspath(new_name), fldr=fldr, tags=', '.join(f'"{t}"' for t in tags))

if __name__ == '__main__':
confdir = os.path.expanduser('~/.config/watchman/')
Expand All @@ -116,13 +116,15 @@ def process_file(rules, variables, path: str):
variables, rules = parse_config(f)
if len(sys.argv) > 0:
items = [process_file(rules, variables, infile) for infile in sys.argv[1:]]
with NamedTemporaryFile(mode='w', delete=True) as tempf:
scpt = script.format(items='\n'.join(i for i in items if i))
tempf.write(scpt)
tempf.flush()
out = check_output(['/usr/bin/osascript', tempf.name], stderr=STDOUT)
if out and out.strip() != b'true':
print(out.decode())
items = [i for i in items if i]
if items:
with NamedTemporaryFile(mode='w', delete=True) as tempf:
scpt = script.format(items='\n'.join(items))
tempf.write(scpt)
tempf.flush()
out = check_output(['/usr/bin/osascript', tempf.name], stderr=STDOUT)
if out and out.strip() != b'true':
print(out.decode())

else:
sys.exit(1)
7 changes: 2 additions & 5 deletions shell/commands.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
hash trash 2>/dev/null && alias rm=trash
alias wifi="networksetup -setairportpower en0"
which networksetup &>/dev/null && alias wifi="networksetup -setairportpower en0"
alias timestamp='gawk "{now=strftime(\"%F %T \"); print now \$0; fflush(); }"'
alias jsonpy='python -m json.tool'
alias mounted='mount | column -t '
Expand All @@ -10,13 +10,10 @@ which ptpython >/dev/null 2>&1 && alias py='ptpython' && alias ipy='iptpython'
alias rb='ruby'
alias lockme="xscreensaver-command -lock"
alias disas='objdump -d -M intel'
alias scanb='scan-build --use-analyzer=$(which clang-3.5)'
alias latexmk='latexmk -pvc'
alias aplay='ansible-playbook playbook.yml -i inventory'
# Fix pyenv and homebrew *-config issues
which nvim >/dev/null 2>&1 && alias vim=nvim
which thefuck >/dev/null && eval "$(thefuck --alias)"
which nvim &>/dev/null && alias vim=nvim
alias b='build'
alias p='provision'
which hopper > /dev/null && alias h='hopper' && alias he='hopper -e'
alias dk=docker
31 changes: 0 additions & 31 deletions shell/dynamorio.sh

This file was deleted.

9 changes: 9 additions & 0 deletions shell/history.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
if [[ "$SHELL" == *zsh ]]; then
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
fi

export HISTSIZE=1000
unset HISTFILE

if test -d "$HOME/.zsh-histdb"; then
source "$HOME/.zsh-histdb/sqlite-history.zsh"
export HISTDB_FILE="$HOME/.zsh-history.db"
Expand Down
20 changes: 0 additions & 20 deletions shell/ltx.sh

This file was deleted.

7 changes: 0 additions & 7 deletions shell/exports.sh → shell/z_final.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,3 @@ unset HISTFILE
for i in `ls ~/.secret/*.sh`; do
source $i
done

# Not sure why this is here.
# case $(uname -s) in
# Linux)
# export _JAVA_AWT_WM_NONREPARENTING=1
# ;;
# esac

0 comments on commit e67d33e

Please sign in to comment.