patching is da wae
This commit is contained in:
parent
0a5d5f29f9
commit
c12182484a
2 changed files with 30 additions and 1 deletions
22
nix/migrate-version.patch
Normal file
22
nix/migrate-version.patch
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
diff --git a/sql-migrate/config.go b/sql-migrate/config.go
|
||||||
|
index 6947a53..df394d8 100644
|
||||||
|
--- a/sql-migrate/config.go
|
||||||
|
+++ b/sql-migrate/config.go
|
||||||
|
@@ -6,7 +6,6 @@ import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
- "runtime/debug"
|
||||||
|
|
||||||
|
"github.com/go-gorp/gorp/v3"
|
||||||
|
"gopkg.in/yaml.v2"
|
||||||
|
@@ -112,8 +111,5 @@ func GetConnection(env *Environment) (*sql.DB, string, error) {
|
||||||
|
|
||||||
|
// GetVersion returns the version.
|
||||||
|
func GetVersion() string {
|
||||||
|
- if buildInfo, ok := debug.ReadBuildInfo(); ok && buildInfo.Main.Version != "(devel)" {
|
||||||
|
- return buildInfo.Main.Version
|
||||||
|
- }
|
||||||
|
- return "dev"
|
||||||
|
+ return "@current_version@"
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
, lib
|
, lib
|
||||||
, buildGoModule
|
, buildGoModule
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, substituteAll
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
|
@ -20,7 +21,13 @@ buildGoModule rec {
|
||||||
ldflags = [
|
ldflags = [
|
||||||
"-s"
|
"-s"
|
||||||
"-w"
|
"-w"
|
||||||
"-X Main.Version=v${version}"
|
];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(substituteAll {
|
||||||
|
src = ./migrate-version.patch;
|
||||||
|
current_version = "v${version}";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
Loading…
Reference in a new issue