Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #64 from caarlos0/zsh
Browse files Browse the repository at this point in the history
shellcheck doesnt support zsh anymore, working around
  • Loading branch information
caarlos0 committed May 6, 2015
2 parents d896ae2 + 32491b1 commit ac7e679
Show file tree
Hide file tree
Showing 50 changed files with 71 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .rultor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ install:
- git submodule update
- locale
- ./build/install.sh
- ./build.sh
- ./build/build.sh
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ language: bash
install:
- ./build/install.sh
script:
- ./build.sh
- ./build/build.sh
notifications:
email: false
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ If you're brand-new to the project and run into any blockers, please
[open an issue](https://github.com/caarlos0/dotfiles/issues) on this repository
and I'd love to get it fixed for you!

## known issues

- All SC2039 ignores should be fixed (#65);

## contributing

Feel free to contribute. Pull requests will be automatically
Expand Down
2 changes: 1 addition & 1 deletion antigen/install.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
touch ~/.z
2 changes: 1 addition & 1 deletion antigen/path.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
source "$ZSH/antigen/antigen/antigen.zsh"
2 changes: 1 addition & 1 deletion atom.symlink/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" = "Darwin" ] && brew cask install atom
apm install \
editorconfig autocomplete-plus \
Expand Down
5 changes: 3 additions & 2 deletions bin/dot
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/bin/zsh
#!/bin/sh
#
# dot
#
# `dot` handles installation, updates, things like that. Run it periodically
# to make sure you're on the latest and greatest.
main() {
cd ~/.dotfiles
# shellcheck disable=SC2155
export ZSH="$(pwd)"
echo "Updating dotfiles..."
git pull origin master

echo "Updating antigen plugins..."
git submodule update
source ./antigen/antigen/antigen.zsh
. ./antigen/antigen/antigen.zsh
antigen apply
antigen update

Expand Down
2 changes: 1 addition & 1 deletion bin/e
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
#
# Quick shortcut to an editor.
#
Expand Down
7 changes: 4 additions & 3 deletions bin/git-add-rm-line-count
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
set -eo pipefail
add_rm_lc() {
local diff_result=$(git diff)
local added=$(echo "$diff_result" | grep -c '^+')
local deleted=$(echo "$diff_result" | grep -c '^-')
local diff_result added deleted
diff_result=$(git diff)
added=$(echo "$diff_result" | grep -c '^+')
deleted=$(echo "$diff_result" | grep -c '^-')
echo "${added} additions and ${deleted} deletions."
}
add_rm_lc "$@"
2 changes: 1 addition & 1 deletion bin/killport
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
kill -9 "$(lsof -i tcp:"$1" | head -n 2 | tail -n 1 | awk '{print $2}')"
2 changes: 1 addition & 1 deletion bin/lsopenports
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
lsof -i -n -P
2 changes: 1 addition & 1 deletion build
Submodule build updated from 1df67b to c568d5
4 changes: 0 additions & 4 deletions build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docker/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
if [ "$(uname -s)" = "Darwin" ]; then
brew cask install kitematic
fi
2 changes: 1 addition & 1 deletion docker/path.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
reload-docker() {
eval "$(docker-machine env dev)"
}
Expand Down
2 changes: 1 addition & 1 deletion functions/c
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
cd "$PROJECTS/$1"
2 changes: 1 addition & 1 deletion functions/d
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
cd "$ZSH/$1"
3 changes: 1 addition & 2 deletions functions/extract
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
# credit: http://nparikh.org/notes/zshrc.txt
# Usage: extract <file>
# Description: extracts archived files / mounts disk images
Expand All @@ -25,4 +25,3 @@ extract () {
echo "'$1' is not a valid file"
fi
}

2 changes: 1 addition & 1 deletion functions/h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
cd "$HOME/$1"
4 changes: 2 additions & 2 deletions functions/server
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/zsh
function server {
#!/bin/sh
server() {
local port="${1-8000}"
python -m SimpleHTTPServer "$port" &
open "http://localhost:$port"
Expand Down
2 changes: 1 addition & 1 deletion git/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
alias gl='git pull --prune'
alias glg="git log --graph --decorate --oneline --abbrev-commit"
alias gp='git push origin HEAD'
Expand Down
2 changes: 1 addition & 1 deletion git/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" != "Darwin" ] && return 0
brew install git
2 changes: 1 addition & 1 deletion golang/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" != "Darwin" ] && return 0
brew install go
2 changes: 1 addition & 1 deletion golang/path.zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/zsh
#!/bin/sh
export GOPATH="$PROJECTS/Go"
[ ! -d "$GOPATH" ] && mkdir -p "$GOPATH"
2 changes: 1 addition & 1 deletion homebrew/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
brewbump() {
brew update
brew upgrade --all
Expand Down
2 changes: 1 addition & 1 deletion homebrew/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
#
# Homebrew
#
Expand Down
2 changes: 1 addition & 1 deletion java/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh

mvn() {
# shellcheck disable=SC2068
Expand Down
2 changes: 1 addition & 1 deletion java/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" != "Darwin" ] && return 0

# install some java stuff
Expand Down
2 changes: 1 addition & 1 deletion java/path.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
export MAVEN_OPTS="-Xmx1024m"
2 changes: 1 addition & 1 deletion node/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
alias npis='npm install --save'
alias npisd='npm install --save-dev'
alias npig='npm install -g'
Expand Down
2 changes: 1 addition & 1 deletion node/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" != "Darwin" ] && return 0
brew install node
2 changes: 1 addition & 1 deletion node/path.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
export PATH="/usr/local/share/npm/bin:$PATH"
export PATH="$PATH:$HOME/.npm/bin"

4 changes: 2 additions & 2 deletions postgres/path.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
if [[ "$(uname -s)" = "Darwin" ]]; then
#!/bin/sh
if [ "$(uname -s)" = "Darwin" ]; then
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
fi
2 changes: 1 addition & 1 deletion ruby/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
alias migrate='rake db:migrate'
alias fs='bundle exec foreman start'
alias fsdev='bundle exec foreman start -f Procfile.dev'
2 changes: 1 addition & 1 deletion ruby/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" != "Darwin" ] && return 0

if test ! "$(which rbenv)"; then
Expand Down
3 changes: 2 additions & 1 deletion ruby/path.zsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/zsh
#!/bin/sh
if [ -d "$HOME/.rbenv" ]; then
export PATH="$HOME/.rbenv/bin:$PATH"
fi
# shellcheck disable=SC2039
if rbenv &>/dev/null; then
eval "$(rbenv init -)"
fi
2 changes: 1 addition & 1 deletion ruby/rbenv.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
# rehash shims
rbenv rehash 2>/dev/null

Expand Down
2 changes: 1 addition & 1 deletion script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ link_file () {

if [ "$overwrite_all" == "false" ] && [ "$backup_all" == "false" ] && [ "$skip_all" == "false" ]
then
# shellcheck disable=SC2086
# shellcheck disable=SC2086,SC2155
local currentSrc="$(readlink $dst)"

if [ "$currentSrc" == "$src" ]
Expand Down
2 changes: 1 addition & 1 deletion slate/install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" != "Darwin" ] && return 0
brew cask install slate
2 changes: 1 addition & 1 deletion ssh/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
2 changes: 1 addition & 1 deletion sublime-text-3/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh

if [ "$(uname -s)" = "Darwin" ]; then
brew cask install sublime-text3
Expand Down
11 changes: 6 additions & 5 deletions system/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/zsh
#!/bin/sh
# grc overides for ls
# Made possible through contributions from generous benefactors like
# `brew install coreutils`
# shellcheck disable=SC2039
if gls &>/dev/null; then
alias ls="gls -F --color"
alias l="gls -lAh --color"
Expand All @@ -17,17 +18,17 @@ alias grep="grep --color=auto"
alias duf="du -sh * | sort -hr"
alias less="less -r"

if [[ -z $(command -v pbcopy) ]]; then
if [[ -n $(command -v xclip) ]]; then
if [ -z "$(command -v pbcopy)" ]; then
if [ -n "$(command -v xclip)" ]; then
alias pbcopy="xclip -selection clipboard"
alias pbpaste="xclip -selection clipboard -o"
elif [[ -n $(command -v xsel) ]]; then
elif [ -n "$(command -v xsel)" ]; then
alias pbcopy="xsel --clipboard --input"
alias pbpaste="xsel --clipboard --output"
fi
fi

if [[ "$(uname -s)" != "Darwin" ]]; then
if [ "$(uname -s)" != "Darwin" ]; then
if [ -e /usr/bin/xdg-open ]; then
alias open="xdg-open"
fi
Expand Down
2 changes: 1 addition & 1 deletion system/env.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/zsh
#!/bin/sh
export EDITOR='atom'
5 changes: 3 additions & 2 deletions system/grc.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/zsh
#!/bin/sh
# GRC colorizes nifty unix tools all over the place
# shellcheck disable=2039
if grc &>/dev/null && ! brew &>/dev/null; then
source "$(brew --prefix)/etc/grc.bashrc"
. "$(brew --prefix)/etc/grc.bashrc"
fi
2 changes: 1 addition & 1 deletion system/path.zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/zsh
#!/bin/sh
export PATH="./bin:/usr/local/bin:/usr/local/sbin:$ZSH/bin:$PATH"
export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
2 changes: 1 addition & 1 deletion terminator/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
[ "$(uname -s)" = "Darwin" ] && return 0
mkdir -p ~/.config/terminator/
ln -sf "$ZSH"/terminator/base16-ocean-dark.config ~/.config/terminator/config
2 changes: 1 addition & 1 deletion vim/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh
#!/bin/sh
setup_command_t() {
cd "$ZSH"/vim/vimfiles/vim.symlink/bundle/command-t/ruby/command-t
ruby extconf.rb
Expand Down
6 changes: 3 additions & 3 deletions zsh/aliases.zsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/zsh
#!/bin/sh
__reload_dotfiles() {
export PATH="$(command -p getconf PATH)"
source ~/.zshrc
PATH="$(command -p getconf PATH)"
. ~/.zshrc
cd .
}
alias reload!='__reload_dotfiles'
4 changes: 2 additions & 2 deletions zsh/completion.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/zsh
# Force rehash when command not found
_force_rehash() {
(( CURRENT == 1 )) && rehash
return 1
(( CURRENT == 1 )) && rehash
return 1
}

# forces zsh to realize new commands
Expand Down
4 changes: 2 additions & 2 deletions zsh/window.zsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/zsh
#!/bin/sh
# From http://dotfiles.org/~_why/.zshrc
# Sets the window title nicely no matter where you are
function title() {
title() {
# escape '%' chars in $1, make nonprintables visible
a=${(V)1//\%/\%\%}

Expand Down

0 comments on commit ac7e679

Please sign in to comment.