Fixes to get it to run in the cloud
This commit is contained in:
		
							
								
								
									
										3
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
									
									
									
									
								
							@ -48,6 +48,9 @@ docker-build:
 | 
				
			|||||||
docker-run: docker-build
 | 
					docker-run: docker-build
 | 
				
			||||||
	@docker run -it -v `pwd`/build:/etc/birdbot yeslayla/birdbot:latest
 | 
						@docker run -it -v `pwd`/build:/etc/birdbot yeslayla/birdbot:latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker-push: docker-build
 | 
				
			||||||
 | 
						@docker push yeslayla/birdbot:latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## install: Download and install dependencies
 | 
					## install: Download and install dependencies
 | 
				
			||||||
install: go-get
 | 
					install: go-get
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,6 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"log"
 | 
						"log"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/signal"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/bwmarrin/discordgo"
 | 
						"github.com/bwmarrin/discordgo"
 | 
				
			||||||
	"github.com/ilyakaznacheev/cleanenv"
 | 
						"github.com/ilyakaznacheev/cleanenv"
 | 
				
			||||||
@ -32,9 +31,9 @@ func (app *Bot) Initialize(config_path string) error {
 | 
				
			|||||||
	_, err := os.Stat(config_path)
 | 
						_, err := os.Stat(config_path)
 | 
				
			||||||
	if errors.Is(err, os.ErrNotExist) {
 | 
						if errors.Is(err, os.ErrNotExist) {
 | 
				
			||||||
		log.Printf("Config file not found: '%s'", config_path)
 | 
							log.Printf("Config file not found: '%s'", config_path)
 | 
				
			||||||
		err := cleanenv.ReadEnv(&cfg)
 | 
							err := cleanenv.ReadEnv(cfg)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return nil
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		err := cleanenv.ReadConfig(config_path, cfg)
 | 
							err := cleanenv.ReadConfig(config_path, cfg)
 | 
				
			||||||
@ -77,7 +76,6 @@ func (app *Bot) Run() error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Keep alive
 | 
						// Keep alive
 | 
				
			||||||
	app.stop = make(chan os.Signal, 1)
 | 
						app.stop = make(chan os.Signal, 1)
 | 
				
			||||||
	signal.Notify(app.stop, os.Interrupt)
 | 
					 | 
				
			||||||
	<-app.stop
 | 
						<-app.stop
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user