File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ func main() {
52
52
Usage : "skip build and only upload pre-build packages" ,
53
53
EnvVar : "PLUGIN_SKIP_BUILD" ,
54
54
},
55
+ cli.StringFlag {
56
+ Name : "dist_dir" ,
57
+ Usage : "used when distribution directory is not in build root" ,
58
+ Value : "dist/" ,
59
+ EnvVar : "PLUGIN_DIST_DIR" ,
60
+ },
55
61
}
56
62
57
63
app .Run (os .Args )
@@ -65,6 +71,7 @@ func run(c *cli.Context) {
65
71
SetupFile : c .String ("setupfile" ),
66
72
Distributions : c .StringSlice ("distributions" ),
67
73
SkipBuild : c .Bool ("skip_build" ),
74
+ DistDir : c .String ("dist_dir" ),
68
75
}
69
76
70
77
if err := plugin .Exec (); err != nil {
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package main
3
3
import (
4
4
"log"
5
5
"os/exec"
6
+ "path/filepath"
6
7
7
8
"github.com/pkg/errors"
8
9
)
@@ -15,6 +16,7 @@ type Plugin struct {
15
16
SetupFile string
16
17
Distributions []string
17
18
SkipBuild bool
19
+ DistDir string
18
20
}
19
21
20
22
func (p Plugin ) buildCommand () * exec.Cmd {
@@ -40,7 +42,7 @@ func (p Plugin) uploadCommand() *exec.Cmd {
40
42
args = append (args , p .Username )
41
43
args = append (args , "--password" )
42
44
args = append (args , p .Password )
43
- args = append (args , "dist /*" )
45
+ args = append (args , filepath . Join ( p . DistDir , " /*") )
44
46
45
47
return exec .Command ("twine" , args ... )
46
48
}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ func TestPublish(t *testing.T) {
17
17
SetupFile : "testdata/setup.py" ,
18
18
Distributions : strings .Split (os .Getenv ("PLUGIN_DISTRIBUTIONS" ), " " ),
19
19
SkipBuild : false ,
20
+ DistDir : "dist/" ,
20
21
}
21
22
err := plugin .Exec ()
22
23
if err != nil {
You can’t perform that action at this time.
0 commit comments