mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	provision: Add cd /srv/zulip to profile.
				
					
				
			I didn't bump the provision version on this change, as it won't break anything if somebody fails to make this change.
This commit is contained in:
		@@ -154,16 +154,21 @@ user_id = os.getuid()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
def setup_shell_profile(shell_profile):
 | 
					def setup_shell_profile(shell_profile):
 | 
				
			||||||
    # type: (str) -> None
 | 
					    # type: (str) -> None
 | 
				
			||||||
    source_activate_command = "source %s\n" % (os.path.join(VENV_PATH, "bin", "activate"),)
 | 
					 | 
				
			||||||
    shell_profile_path = os.path.expanduser(shell_profile)
 | 
					    shell_profile_path = os.path.expanduser(shell_profile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if os.path.exists(shell_profile_path):
 | 
					    def write_command(command):
 | 
				
			||||||
        with open(shell_profile_path, 'a+') as shell_profile_file:
 | 
					        # type: (str) -> None
 | 
				
			||||||
            if source_activate_command not in shell_profile_file.read():
 | 
					        if os.path.exists(shell_profile_path):
 | 
				
			||||||
                shell_profile_file.writelines(source_activate_command)
 | 
					            with open(shell_profile_path, 'a+') as shell_profile_file:
 | 
				
			||||||
    else:
 | 
					                if command not in shell_profile_file.read():
 | 
				
			||||||
        with open(shell_profile_path, 'w') as shell_profile_file:
 | 
					                    shell_profile_file.writelines(command + '\n')
 | 
				
			||||||
            shell_profile_file.writelines(source_activate_command)
 | 
					        else:
 | 
				
			||||||
 | 
					            with open(shell_profile_path, 'w') as shell_profile_file:
 | 
				
			||||||
 | 
					                shell_profile_file.writelines(command + '\n')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    source_activate_command = "source " + os.path.join(VENV_PATH, "bin", "activate")
 | 
				
			||||||
 | 
					    write_command(source_activate_command)
 | 
				
			||||||
 | 
					    write_command('cd /srv/zulip')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main(options):
 | 
					def main(options):
 | 
				
			||||||
    # type: (Any) -> int
 | 
					    # type: (Any) -> int
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user