Resolve issue with debian package building, use $HOME/.config/pastee as config path
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Tyler 2021-03-27 18:15:26 -04:00
parent 9c0c218f46
commit 5901ca6d6c
2 changed files with 6 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"os"
"path"
)
var rootCmd = &cobra.Command{
@ -48,9 +49,10 @@ func initConfig() {
home, err := homedir.Dir()
cobra.CheckErr(err)
viper.SetConfigName(".pastee")
viper.SetConfigName("pastee")
viper.SetConfigType("yaml")
viper.AddConfigPath(home)
viper.AddConfigPath(path.Join(home, ".config", "pastee"))
viper.AddConfigPath("/etc")
if err := viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); ok {

View File

@ -1,13 +1,13 @@
fpm -s dir -t deb -p /build/pastee_${DRONE_TAG}_${ARCH}.deb \
-n pastee -v $DRONE_SEMVER -a $ARCH \
--deb-priority optional --force \
--deb-compression bzip2 \
--deb-compression gz --verbose \
--description "Paste.ee CLI Tool" \
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee
fpm -s dir -t rpm -p /build/pastee_${DRONE_TAG}_${ARCH}.rpm \
-n pastee -v $DRONE_SEMVER -a $ARCH \
--description "Paste.ee CLI Tool" \
--description "Paste.ee CLI Tool" --verbose \
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee