@@ -69,31 +69,35 @@ def change_activate_now(self, switch, GParamBoolean):
69
69
70
70
def install_dotfiles (self ):
71
71
72
+ printLog ("Installing dotfiles " + self .props .id )
72
73
if not os .path .exists (self .props .dotfiles_folder ):
73
74
pathlib .Path (self .props .dotfiles_folder ).mkdir (parents = True , exist_ok = True )
74
75
75
76
if not self .activate :
76
77
# Copy prepared folder to the dotfiles folder
77
78
shutil .copytree (self .props .prepared_folder , self .props .dotfiles_folder , dirs_exist_ok = True )
79
+ printLog ("Installing dotfiles " + self .props .prepared_folder + " to " + self .props .dotfiles_folder )
78
80
79
- if get_symlink_enabled ():
81
+ if get_symlink_enabled () and self . activate_now . get_active () :
80
82
# Create symlinks for all files and folders except for .dotinst files
83
+ printLog ("Creating symlinks..." )
81
84
for f in os .listdir (self .props .dotfiles_folder ):
82
85
if f != ".config" and ".dotinst" not in f :
83
86
self .createSymlink (self .props .dotfiles_folder + "/" + f , home_folder + f )
84
87
for f in os .listdir (self .props .dotfiles_folder + "/.config" ):
85
88
if ".dotinst" not in f :
86
89
self .createSymlink (self .props .dotfiles_folder + "/.config/" + f , home_folder + ".config/" + f )
90
+
91
+ # Write dotfiles config file to dotfiles folder
92
+ dotfiles_json = {}
93
+ dotfiles_json ["active" ] = self .props .id
94
+ with open (get_installed_dotfiles_folder () + 'dotfiles.json' , 'w' , encoding = 'utf-8' ) as f :
95
+ json .dump (dotfiles_json , f , ensure_ascii = False , indent = 4 )
96
+
87
97
else :
88
98
printLog ("Creating of symlinks disabled in preferences. Installation has been skipped." )
89
99
90
- # Write dotfiles config file to dotfiles folder
91
- dotfiles_json = {}
92
- dotfiles_json ["active" ] = self .props .id
93
- with open (get_installed_dotfiles_folder () + 'dotfiles.json' , 'w' , encoding = 'utf-8' ) as f :
94
- json .dump (dotfiles_json , f , ensure_ascii = False , indent = 4 )
95
-
96
- self .activated = False
100
+ self .activate = False
97
101
98
102
# Delete existing symlink, file or folder
99
103
def delete_file_in_sandbox (self ,filepath ):
0 commit comments