Skip to content

Commit

Permalink
Allow to exclude symlinking of files base on git exclude patterns
Browse files Browse the repository at this point in the history
    HOMESHICK_IGNORE environment variable with comma-separated
    exclude patterns will add entries to .git/info/exclude

    Excluded files will be ignored during symlink step, but still
    can be checked into the repository
  • Loading branch information
antontsv committed Aug 15, 2016
1 parent a2fe048 commit 2136eba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/commands/clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function clone {
success
fi
[ -n "$HOMESHICK_USE_CASTLE_ROOT" ] && set_castle_root_mode "$cloned_castle_name"
[ -n "$HOMESHICK_IGNORE" ] && echo "$HOMESHICK_IGNORE" | tr ',' '\n' >> "$repo_path/.git/info/exclude"
return $EX_SUCCESS
}

Expand Down
2 changes: 2 additions & 0 deletions lib/commands/link.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ function get_repo_files {
# (used when there are newlines in the path)
path=${path/#\"/}
path=${path/%\"/}
local excluded=$(cd "$root" && git ls-files -i --exclude-from=.git/info/exclude "$path")
[ -n "$excluded" ] && continue;
if [ -n "$search" ];then
# Check if home/ is a submodule
[[ $path == 'home' ]] && continue
Expand Down

0 comments on commit 2136eba

Please sign in to comment.