mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Able to use GOGS_WORK_DIR environment variable to specify work directory
				
					
				
			This commit is contained in:
		@@ -201,6 +201,11 @@ func ExecPath() (string, error) {
 | 
			
		||||
 | 
			
		||||
// WorkDir returns absolute path of work directory.
 | 
			
		||||
func WorkDir() (string, error) {
 | 
			
		||||
	wd := os.Getenv("GOGS_WORK_DIR")
 | 
			
		||||
	if len(wd) > 0 {
 | 
			
		||||
		return wd, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	execPath, err := ExecPath()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return execPath, err
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user