mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-04-28 05:02:26 +00:00
custom oh-my-zsh location
This commit is contained in:
parent
d55646b1d4
commit
d3ba3d2b52
1 changed files with 25 additions and 6 deletions
|
@ -19,17 +19,36 @@ def check_installation():
|
||||||
Print.err('Dotfiles installation cancelled - zsh not installed')
|
Print.err('Dotfiles installation cancelled - zsh not installed')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
elif not Path.check_dir_exists('~/.oh-my-zsh ~/oh-my-zsh ~/ohmyzsh ~/.config/oh-my-zsh /usr/shared/oh-my-zsh'):
|
global oh_my_zsh_path
|
||||||
# TODO: Option to install
|
oh_my_zsh_path = None
|
||||||
Print.err('oh-my-zsh is not installed, cannot proceed...')
|
if Path.check_dir_exists('~/.oh-my-zsh'):
|
||||||
return False
|
oh_my_zsh_path = '$HOME/.oh-my-zsh'
|
||||||
|
elif Path.check_dir_exists('~/oh-my-zsh'):
|
||||||
|
oh_my_zsh_path = '$HOME/oh-my-zsh'
|
||||||
|
elif Path.check_dir_exists('~/ohmyzsh'):
|
||||||
|
oh_my_zsh_path = '$HOME/ohmyzsh'
|
||||||
|
elif Path.check_dir_exists('~/.config/oh-my-zsh'):
|
||||||
|
oh_my_zsh_path = '$HOME/.config/oh-my-zsh'
|
||||||
|
elif Path.check_dir_exists('/usr/share/oh-my-zsh'):
|
||||||
|
oh_my_zsh_path = '/usr/share/oh-my-zsh'
|
||||||
|
|
||||||
else:
|
if oh_my_zsh_path:
|
||||||
return True
|
return True
|
||||||
|
else:
|
||||||
|
Print.err('oh-my-zsh is not installed, cannot proceed...')
|
||||||
|
# TODO: Option to install
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def personalized_changes(file):
|
def personalized_changes(file):
|
||||||
pass
|
if '.zshrc' in file:
|
||||||
|
filedata = None
|
||||||
|
with open(file, 'r') as f:
|
||||||
|
filedata = f.read()
|
||||||
|
filedata = filedata.replace('"$HOME/.config/oh-my-zsh"', f'"{oh_my_zsh_path}"')
|
||||||
|
Print.err('Rewriting')
|
||||||
|
with open(file, 'w') as f:
|
||||||
|
f.write(filedata)
|
||||||
|
|
||||||
|
|
||||||
def init(symlink):
|
def init(symlink):
|
||||||
|
|
Loading…
Add table
Reference in a new issue