[~] Refactor

This commit is contained in:
Siarhei Siniak 2024-11-29 21:17:34 +03:00
parent 8656b3b985
commit 64706907ca
4 changed files with 34 additions and 7 deletions

@ -43,6 +43,14 @@ dotfiles_put:
cp -rp \ cp -rp \
dotfiles/.ipython/profile_default/ipython_config.py \ dotfiles/.ipython/profile_default/ipython_config.py \
~/.ipython/profile_default/ipython_config.py ~/.ipython/profile_default/ipython_config.py
D1=Code\ -\ OSS; \
for p in \
"dotfiles/.config/$$D1/User/keybindings.json" \
"dotfiles/.config/$$D1/User/settings.json"; do \
commands install -f -p "dotfiles/.config/$$D1" -s "$$p" -t ~/.config/"$$D1"; \
done
#commands install -f -p dotfiles -s dotfiles/ -t ~/.config/
dotfiles_fetch: dotfiles_fetch:
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/keybindings.json -t dotfiles commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/keybindings.json -t dotfiles
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/settings.json -t dotfiles

@ -0,0 +1,6 @@
{
"editor.wordWrap": "on",
"editor.minimap.autohide": true,
"editor.minimap.maxColumn": 80,
"editor.minimap.size": "fit"
}

@ -3746,17 +3746,30 @@ def install(argv: list[str]) -> None:
if not options.overwrite: if not options.overwrite:
raise NotImplementedError raise NotImplementedError
shutil.rmtree(str(final_target)) if final_target.is_dir():
shutil.rmtree(final_target)
else:
os.unlink(final_target)
if options.source.is_dir() and not options.recursive: if options.source.is_dir() and not options.recursive:
raise NotImplementedError raise NotImplementedError
os.makedirs(final_target, exist_ok=True,) if options.source.is_dir():
os.makedirs(final_target, exist_ok=True,)
else:
os.makedirs(final_target.parent, exist_ok=True,)
shutil.copy( subprocess.check_call([
options.source, 'cp', '-rp',
final_target, str(options.source),
) '-T',
str(final_target),
])
#shutil.copy(
# options.source,
# final_target.parent,
#)
logger.info(dict(msg='done')) logger.info(dict(msg='done'))