From 2249ffab4bdac45dc50155dfe2b5fd850ea3ae59 Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Mon, 9 Jan 2023 17:06:21 -0600 Subject: [PATCH] maybe i gotta rethink my whole approach on windows --- .vim/ftplugin/rust.vim | 4 +++- installer/targets.py | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.vim/ftplugin/rust.vim b/.vim/ftplugin/rust.vim index 0f403a9..4acfef2 100644 --- a/.vim/ftplugin/rust.vim +++ b/.vim/ftplugin/rust.vim @@ -1 +1,3 @@ -nnoremap :ALEGoToDefinition +if !has('nvim') + nnoremap :ALEGoToDefinition +endif diff --git a/installer/targets.py b/installer/targets.py index 0c2da59..e4740ba 100644 --- a/installer/targets.py +++ b/installer/targets.py @@ -137,12 +137,16 @@ class WSLHost(Target): print(f"is link: {is_link}") if target_path.exists(): print("target path exists") - if target_path.is_file(): - print("removing existing regular file") - target_path.unlink() - else: - print("skip: target path exists and is not a regular file") - return + if source_path.is_file(): + if target_path.is_file(): + print("removing existing regular file") + target_path.unlink() + else: + print("skip: target path exists and is not a regular file") + return + elif source_path.is_dir(): + print("removing existing file tree") + shutil.rmtree(target_path) else: print("target path does not exist") print("copying file to target")