1
Fork 0

Compare commits

..

No commits in common. "22c05c3eba9898edc0ece03255a7cf562e4cf8e1" and "811943868c3aa0790b4eef9e4024168e3d98bd69" have entirely different histories.

4 changed files with 10 additions and 54 deletions

View File

@ -1,11 +1,7 @@
[PowerShell] [PowerShell]
in="src/PowerShell/profile.ps1" in="src/PowerShell/profile.ps1"
out="~/Documents/WindowsPowerShell/profile.ps1" out="~/Documents/WindowsPowerShell"
[Git] [Git]
in="src/Git/gitconfig-win" in="src/git/gitconfig-win"
out="~/.gitconfig" out="~/.gitconfig"
[Neovim]
in="src/Neovim/init.vim"
out="~/AppData/Local/nvim/init.vim"

View File

@ -2,4 +2,8 @@ import pathlib
def get_io(conf): def get_io(conf):
return pathlib.Path(conf.get("in")).expanduser(), pathlib.Path(conf.get("out")).expanduser() _in = pathlib.Path(conf.get("in")).expanduser()
_out = pathlib.Path(conf.get("out")).expanduser()
if _out.is_dir():
_out = _out.joinpath(_in.name)
return _in, _out

View File

@ -37,27 +37,11 @@ for _name, _conf in config.items():
if not _in.is_file(): if not _in.is_file():
log.error(f"{_name} configuration <{_in}> could not be found.") log.error(f"{_name} configuration <{_in}> could not be found.")
sys.exit(1) sys.exit(1)
if _out.exists():
if _out.is_file():
_yn = input(f"<{_out}> already exists; replace [Yn] ?").strip().lower()
if _yn != "y" and _yn != "":
log.info(f"Skipping {_name} configuration.")
continue
else:
log.info(f"Installing {_name} configuration.")
else:
log.error(f"<{_out}> already exists and is not a file.")
sys.exit(1)
if not _out.parent.exists():
_out.parent.mkdir(parents=True)
elif not _out.parent.is_dir():
log.error(f"{_name} configuration could not be installed as <{_out.parent}> is not a directory.")
sys.exit(1)
try: try:
shutil.copyfile(_in, _out) shutil.copyfile(_in, _out)
except FileNotFoundError:
log.error(f"{_name} could not be configured: destination <{_out}> could not be found.")
sys.exit(1)
except OSError: except OSError:
log.error(f"{_name} could not be configured: destination <{_out}> is not writable.") log.error(f"{_name} could not be configured: destination <{_out}> is not writable.")
sys.exit(1) sys.exit(1)

View File

@ -1,28 +0,0 @@
"Clipboard
set clipboard+=unnamedplus
"Tabulations
set tabstop=2
set shiftwidth=2
set noexpandtab
"Mouse
set mouse=a
"Search
set ignorecase
"Completion
set wildmode=longest,list,full
"Line numbers
set number
"Text wrap
set tw=119
set cc=120
"Split side
set splitright
set splitbelow