Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 25, 2022. It is now read-only.
/packrPublic archive

Commitb4b6d10

Browse files
authored
Remove packr2 dep on envy (#257)
* Remove packr2 dep on envyExtract the only parts needed from envy. This will prevent the envypackage to load .env files on init and cause unexpected behavior.* Fix duplicate go version in disk-pack/go.mod
1 parentaf4670f commitb4b6d10

File tree

7 files changed

+53
-24
lines changed

7 files changed

+53
-24
lines changed

‎v2/go.mod‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ module github.com/gobuffalo/packr/v2
33
go1.13
44

55
require (
6-
github.com/gobuffalo/envyv1.7.1
7-
github.com/gobuffalo/loggerv1.0.1
6+
github.com/gobuffalo/loggerv1.0.3
87
github.com/gobuffalo/packdv0.3.0
8+
github.com/konsorten/go-windows-terminal-sequencesv1.0.2// indirect
99
github.com/rogpeppe/go-internalv1.4.0
1010
github.com/sirupsen/logrusv1.4.2
1111
github.com/spf13/cobrav0.0.5
1212
github.com/stretchr/testifyv1.4.0
1313
golang.org/x/syncv0.0.0-20190911185100-cd5d95a43a6e
14+
golang.org/x/sysv0.0.0-20190515120540-06a5c4944438// indirect
1415
golang.org/x/toolsv0.0.0-20191004055002-72853e10c5a3
1516
)

‎v2/go.sum‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
88
github.com/davecgh/go-spewv1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
99
github.com/davecgh/go-spewv1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1010
github.com/fsnotify/fsnotifyv1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
11-
github.com/gobuffalo/envyv1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
12-
github.com/gobuffalo/envyv1.7.1 h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8=
13-
github.com/gobuffalo/envyv1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w=
14-
github.com/gobuffalo/loggerv1.0.1 h1:ZEgyRGgAm4ZAhAO45YXMs5Fp+bzGLESFewzAVBMKuTg=
15-
github.com/gobuffalo/loggerv1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs=
11+
github.com/gobuffalo/loggerv1.0.3 h1:YaXOTHNPCvkqqA7w05A4v0k2tCdpr+sgFlgINbQ6gqc=
12+
github.com/gobuffalo/loggerv1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM=
1613
github.com/gobuffalo/packdv0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
1714
github.com/gobuffalo/packdv0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q=
1815
github.com/hashicorp/hclv1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
1916
github.com/inconshreveable/mousetrapv1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
2017
github.com/inconshreveable/mousetrapv1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
21-
github.com/joho/godotenvv1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
22-
github.com/joho/godotenvv1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
2318
github.com/konsorten/go-windows-terminal-sequencesv1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
2419
github.com/konsorten/go-windows-terminal-sequencesv1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
2520
github.com/konsorten/go-windows-terminal-sequencesv1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
@@ -34,9 +29,6 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh
3429
github.com/pelletier/go-tomlv1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
3530
github.com/pmezard/go-difflibv1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
3631
github.com/pmezard/go-difflibv1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
37-
github.com/rogpeppe/go-internalv1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
38-
github.com/rogpeppe/go-internalv1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
39-
github.com/rogpeppe/go-internalv1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
4032
github.com/rogpeppe/go-internalv1.4.0 h1:LUa41nrWTQNGhzdsZ5lTnkwbNjj6rXTdazA1cSdjkOY=
4133
github.com/rogpeppe/go-internalv1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
4234
github.com/russross/blackfridayv1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
@@ -60,8 +52,8 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT
6052
github.com/xordataexchange/cryptv0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
6153
golang.org/x/cryptov0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
6254
golang.org/x/cryptov0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
63-
golang.org/x/cryptov0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A=
64-
golang.org/x/cryptov0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
55+
golang.org/x/cryptov0.0.0-20191122220453-ac88ee75c92c h1:/nJuwDLoL/zrqY6gf57vxC+Pi+pZ8bfhpPkicO5H7W4=
56+
golang.org/x/cryptov0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
6557
golang.org/x/netv0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
6658
golang.org/x/netv0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
6759
golang.org/x/netv0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=

‎v2/helpers.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"runtime"
77
"strings"
88

9-
"github.com/gobuffalo/envy"
109
"github.com/gobuffalo/packr/v2/plog"
1110
)
1211

@@ -31,7 +30,7 @@ func resolutionDirTestFilename(filename, og string) (string, bool) {
3130
returnng,true
3231
}
3332

34-
ng=filepath.Join(envy.GoPath(),"src",ng)
33+
ng=filepath.Join(os.Getenv("GOPATH"),"src",ng)
3534
ifresolutionDirExists(ng,og) {
3635
returnng,true
3736
}

‎v2/internal/envy.go‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package internal
2+
3+
import (
4+
"os"
5+
"runtime"
6+
"strings"
7+
)
8+
9+
// Mods returns true when go modules supports is enabled
10+
funcMods()bool {
11+
go111:=os.Getenv("GO111MODULE")
12+
13+
if!inGoPath() {
14+
returngo111!="off"
15+
}
16+
17+
returngo111=="on"
18+
}
19+
20+
funcinGoPath()bool {
21+
pwd,_:=os.Getwd()
22+
for_,p:=rangeGoPaths() {
23+
ifstrings.HasPrefix(pwd,p) {
24+
returntrue
25+
}
26+
}
27+
returnfalse
28+
}
29+
30+
// GoPaths return the defined gopath list.
31+
funcGoPaths() []string {
32+
gp:=os.Getenv("GOPATH")
33+
ifruntime.GOOS=="windows" {
34+
returnstrings.Split(gp,";")// Windows uses a different separator
35+
}
36+
returnstrings.Split(gp,":")
37+
}

‎v2/jam/store/disk.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"compress/gzip"
66
"crypto/md5"
77
"fmt"
8+
"github.com/gobuffalo/packr/v2/internal"
89
"go/build"
910
"html/template"
1011
"io"
@@ -17,7 +18,6 @@ import (
1718
"strings"
1819
"sync"
1920

20-
"github.com/gobuffalo/envy"
2121
"github.com/gobuffalo/packr/v2/file/resolver/encoding/hex"
2222
"github.com/gobuffalo/packr/v2/plog"
2323
"github.com/rogpeppe/go-internal/modfile"
@@ -254,7 +254,7 @@ func (d *Disk) Close() error {
254254
}
255255

256256
varipstring
257-
ifenvy.Mods() {
257+
ifinternal.Mods() {
258258
// Starting in 1.12, we can rely on Go's method for
259259
// resolving where go.mod resides. Prior versions will
260260
// simply return an empty string.
@@ -285,7 +285,7 @@ func (d *Disk) Close() error {
285285
ip=strings.Replace(ip,"\\","/",-1)
286286
}else {
287287
ip=filepath.Dir(d.DBPath)
288-
srcs:=envy.GoPaths()
288+
srcs:=internal.GoPaths()
289289
srcs=append(srcs,build.Default.SrcDirs()...)
290290
for_,x:=rangesrcs {
291291
ip=strings.TrimPrefix(ip,"/private")

‎v2/packr2/cmd/fix/fix.go‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ import (
66
"os"
77
"strings"
88

9-
"github.com/gobuffalo/envy"
109
"github.com/gobuffalo/packr/v2/jam/store"
1110
)
1211

13-
varmodsOn= (strings.TrimSpace(envy.Get("GO111MODULE","off"))=="on")
14-
1512
//YesToAll will be used by the command to skip the questions
1613
varYesToAllbool
1714

‎v2/packr2/cmd/gocmd.go‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"path/filepath"
88
"strings"
99

10-
"github.com/gobuffalo/envy"
1110
"github.com/gobuffalo/packr/v2/plog"
1211
)
1312

@@ -55,7 +54,11 @@ func goCmd(name string, args ...string) error {
5554
}
5655
}
5756

58-
cp:=exec.Command(envy.Get("GO_BIN","go"),cargs...)
57+
goBin:=os.Getenv("GO_BIN")
58+
ifgoBin=="" {
59+
goBin="go"
60+
}
61+
cp:=exec.Command(goBin,cargs...)
5962
plog.Logger.Debug(strings.Join(cp.Args," "))
6063
cp.Stderr=os.Stderr
6164
cp.Stdin=os.Stdin

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp