Skip to content

Commit

Permalink
chore: update dev deps
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Sep 14, 2023
1 parent e6bde23 commit ae8c2a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2,881 deletions.
23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,18 @@
"license": "MIT",
"private": true,
"scripts": {
"commit": "git-cz"
"commit": "git-cz",
"commitlint": "commitlint --edit"
},
"devDependencies": {
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@commitlint/prompt": "11.0.0",
"@commitlint/prompt-cli": "11.0.0",
"commitizen": "4.2.3",
"@commitlint/cli": "17.7.1",
"@commitlint/config-conventional": "17.7.0",
"@commitlint/prompt": "17.7.1",
"@commitlint/prompt-cli": "17.7.1",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"husky": "4.3.8",
"lint-staged": "10.5.3"
},
"husky": {
"hooks": {
"pre-commit": "make precommit",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"husky": "8.0.3",
"lint-staged": "14.0.1"
},
"config": {
"commitizen": {
Expand Down
10 changes: 6 additions & 4 deletions prestart/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ func initConfig(path string) {
if path != "" {
viper.AddConfigPath(path)
}

// 读取环境变量
viper.SetEnvPrefix("TELEGRAM_BOT_")
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AutomaticEnv()

err := viper.ReadInConfig() // 根据以上配置读取加载配置文件
if err != nil {
var e viper.ConfigFileNotFoundError
Expand All @@ -35,10 +41,6 @@ func initConfig(path string) {
logger.Warn("配置文件不存在,使用默认配置(或从环境变量读取)", zap.Error(err))
}
}
// 读取环境变量
viper.SetEnvPrefix("TELEGRAM_BOT_")
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AutomaticEnv()

logger.Debug(
"已加载配置文件",
Expand Down
Loading

0 comments on commit ae8c2a7

Please sign in to comment.