mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Use native error checking with exec.ErrDot (#22735)
				
					
				
			This was meant to land in #22073 but was blocked until #22732 was merged Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
This commit is contained in:
		| @@ -6,6 +6,7 @@ package setting | |||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"encoding/base64" | 	"encoding/base64" | ||||||
|  | 	"errors" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"math" | 	"math" | ||||||
| 	"net" | 	"net" | ||||||
| @@ -466,8 +467,7 @@ func getAppPath() (string, error) { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		// FIXME: Once we switch to go 1.19 use !errors.Is(err, exec.ErrDot) | 		if !errors.Is(err, exec.ErrDot) { | ||||||
| 		if !strings.Contains(err.Error(), "cannot run executable found relative to current directory") { |  | ||||||
| 			return "", err | 			return "", err | ||||||
| 		} | 		} | ||||||
| 		appPath, err = filepath.Abs(os.Args[0]) | 		appPath, err = filepath.Abs(os.Args[0]) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user