From cf09493486c4fae9dc580d9a4786f94dc8030943 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Wed, 1 Jun 2022 10:42:23 +0200 Subject: [PATCH] zsh chown --- bundles/zsh/items.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/bundles/zsh/items.py b/bundles/zsh/items.py index a3b8670..0052b74 100644 --- a/bundles/zsh/items.py +++ b/bundles/zsh/items.py @@ -7,40 +7,56 @@ for name, user_config in node.metadata.get('users').items(): directories = { join(user_config['home'], '.zsh'): { 'owner': name, + 'group': name, }, join(user_config['home'], '.zsh/oh-my-zsh'): { 'owner': name, + 'group': name, }, join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): { 'owner': name, + 'group': name, 'needs': [ f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}", ] }, } - - + git_deploy = { join(user_config['home'], '.zsh/oh-my-zsh'): { 'repo': 'https://github.com/ohmyzsh/ohmyzsh.git', 'rev': 'master', + 'triggers': [ + f'action:chown_zsh_{name}', + ], }, join(user_config['home'], '.zsh/oh-my-zsh/custom/plugins/zsh-autosuggestions'): { 'repo': 'https://github.com/zsh-users/zsh-autosuggestions.git', 'rev': 'master', + 'triggers': [ + f'action:chown_zsh_{name}', + ], }, } files = { join(user_config['home'], '.zshrc'): { 'owner': name, + 'group': name, 'source': 'zshrc', }, join(user_config['home'], '.zsh/oh-my-zsh/themes/bw.zsh-theme'): { 'owner': name, + 'group': name, 'needs': [ f"git_deploy:{join(user_config['home'], '.zsh/oh-my-zsh')}", ] }, } - + + actions = { + f'chown_zsh_{name}': { + 'command': f"chown -R {name}:{name} {user_config['home']}", + 'triggered': True, + }, + }