mirror of
				https://github.com/beego/bee.git
				synced 2025-11-03 23:03:27 +00:00 
			
		
		
		
	Fix .exe postfix issue on Windows platform.
This commit is contained in:
		@@ -23,6 +23,7 @@ import (
 | 
				
			|||||||
	"strconv"
 | 
						"strconv"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
						"runtime"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var cmdMigrate = &Command{
 | 
					var cmdMigrate = &Command{
 | 
				
			||||||
@@ -146,7 +147,11 @@ func migrateRefresh(currpath, driver, connStr string) {
 | 
				
			|||||||
// migrate generates source code, build it, and invoke the binary who does the actual migration
 | 
					// migrate generates source code, build it, and invoke the binary who does the actual migration
 | 
				
			||||||
func migrate(goal, currpath, driver, connStr string) {
 | 
					func migrate(goal, currpath, driver, connStr string) {
 | 
				
			||||||
	dir := path.Join(currpath, "database", "migrations")	
 | 
						dir := path.Join(currpath, "database", "migrations")	
 | 
				
			||||||
	binary := "m"
 | 
						postfix := ""
 | 
				
			||||||
 | 
						if runtime.GOOS == "windows" {
 | 
				
			||||||
 | 
							postfix = ".exe"
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						binary := "m" + postfix
 | 
				
			||||||
	source := binary + ".go"
 | 
						source := binary + ".go"
 | 
				
			||||||
	// connect to database
 | 
						// connect to database
 | 
				
			||||||
	db, err := sql.Open(driver, connStr)
 | 
						db, err := sql.Open(driver, connStr)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user