Resolve issue with debian package building, use $HOME/.config/pastee as config path
This commit is contained in:
parent
9c0c218f46
commit
5901ca6d6c
|
@ -6,6 +6,7 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
)
|
)
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
|
@ -48,9 +49,10 @@ func initConfig() {
|
||||||
home, err := homedir.Dir()
|
home, err := homedir.Dir()
|
||||||
cobra.CheckErr(err)
|
cobra.CheckErr(err)
|
||||||
|
|
||||||
viper.SetConfigName(".pastee")
|
viper.SetConfigName("pastee")
|
||||||
viper.SetConfigType("yaml")
|
viper.SetConfigType("yaml")
|
||||||
viper.AddConfigPath(home)
|
viper.AddConfigPath(path.Join(home, ".config", "pastee"))
|
||||||
|
viper.AddConfigPath("/etc")
|
||||||
|
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
fpm -s dir -t deb -p /build/pastee_${DRONE_TAG}_${ARCH}.deb \
|
fpm -s dir -t deb -p /build/pastee_${DRONE_TAG}_${ARCH}.deb \
|
||||||
-n pastee -v $DRONE_SEMVER -a $ARCH \
|
-n pastee -v $DRONE_SEMVER -a $ARCH \
|
||||||
--deb-priority optional --force \
|
--deb-priority optional --force \
|
||||||
--deb-compression bzip2 \
|
--deb-compression gz --verbose \
|
||||||
--description "Paste.ee CLI Tool" \
|
--description "Paste.ee CLI Tool" \
|
||||||
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \
|
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \
|
||||||
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee
|
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee
|
||||||
|
|
||||||
fpm -s dir -t rpm -p /build/pastee_${DRONE_TAG}_${ARCH}.rpm \
|
fpm -s dir -t rpm -p /build/pastee_${DRONE_TAG}_${ARCH}.rpm \
|
||||||
-n pastee -v $DRONE_SEMVER -a $ARCH \
|
-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" \
|
-m "Paste.ee <admin@paste.ee>" --vendor "Paste.ee" \
|
||||||
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee
|
-a $ARCH /build/pastee_linux_${ARCH}=/usr/bin/pastee
|
Loading…
Reference in New Issue