e532c4d5cd
Fix posible nil problem Process only merged PRs Rename variable Fix github query for issues Fix typo Split function & fix lint Rename variable name Fix lint error Add generate from issues argument Co-authored-by: jaqra <jaqra@hotmail.com> Reviewed-on: https://gitea.com/gitea/changelog/pulls/44 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: John Olheiser <john.olheiser@gmail.com>
33 lines
590 B
Go
33 lines
590 B
Go
// 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 cmd
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
var (
|
|
MilestoneFlag string
|
|
ConfigPathFlag string
|
|
TokenFlag string
|
|
DetailsFlag bool
|
|
AfterFlag int64
|
|
IssuesFlag bool
|
|
)
|
|
|
|
func getDefaultConfigFile() string {
|
|
pwd, err := os.Getwd()
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
config := filepath.Join(pwd, ".changelog.yml")
|
|
info, err := os.Stat(config)
|
|
if err == nil && !info.IsDir() {
|
|
return config
|
|
}
|
|
return ""
|
|
}
|