Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use rel path in vimrc; handle windows properly

  • Loading branch information...
commit 74f7026c871e9045f60391c1a1af676ea8a2149b 1 parent fc43234
@puzzlet authored
Showing with 13 additions and 7 deletions.
  1. +4 −2 .vimrc
  2. +9 −5 deploy.py
View
6 .vimrc
@@ -44,8 +44,10 @@ map <Up> gk
map <Down> gj
cmap w!! %!sudo tee > /dev/null %
-source ~/devel/_/.vim/vim-pathogen/autoload/pathogen.vim
-call pathogen#infect('~/devel/_/.vim/bundle/{}')
+let s:script_root=fnamemodify(resolve(expand('<sfile>')), ':p:h')
+execute "source " . s:script_root . "/.vim/vim-pathogen/autoload/pathogen.vim"
+let s:tmp = s:script_root . "/.vim/bundle/{}"
+call pathogen#infect(s:tmp)
syntax enable
View
14 deploy.py
@@ -7,11 +7,13 @@
IGNORE = [
'.git',
- '.vim',
'deploy.cmd',
'vendor',
os.path.basename(__file__),
]
+if sys.platform not in ['win32']:
+ # vim's resolve() doesn't work for Windows' symlinks
+ IGNORE.append('.vim')
SKIP_LINK = [
'.irssi/config',
]
@@ -21,13 +23,15 @@ def main():
base_dir = os.path.dirname(os.path.abspath(__file__))
for root, dirs, files in os.walk(base_dir):
_, _, rel_root = root.partition(base_dir)
- rel_root = rel_root.strip('/')
+ rel_root = rel_root.strip(os.sep)
if any(_ in rel_root.split(os.sep) for _ in IGNORE):
continue
- for file_name in files:
- if file_name in IGNORE:
+ for path in files + dirs:
+ if path in IGNORE:
+ if path in dirs:
+ dirs.remove(path)
continue
- rel_path = os.path.join(rel_root, file_name)
+ rel_path = os.path.join(rel_root, path)
logging.debug(rel_path)
make_link(rel_path)
Please sign in to comment.
Something went wrong with that request. Please try again.