mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-02 01:48:30 +02:00
More Options To Specify Repo (#178)
use active user as owner by default Fix #163 Part1 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/178 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: mrsdizzie <info@mrsdizzie.com>
This commit is contained in:
21
modules/utils/path.go
Normal file
21
modules/utils/path.go
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// PathExists returns whether the given file or directory exists or not
|
||||
func PathExists(path string) (bool, error) {
|
||||
_, err := os.Stat(path)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
if os.IsNotExist(err) {
|
||||
return false, nil
|
||||
}
|
||||
return true, err
|
||||
}
|
Reference in New Issue
Block a user