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() {
5252 Usage : "skip build and only upload pre-build packages" ,
5353 EnvVar : "PLUGIN_SKIP_BUILD" ,
5454 },
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+ },
5561 }
5662
5763 app .Run (os .Args )
@@ -65,6 +71,7 @@ func run(c *cli.Context) {
6571 SetupFile : c .String ("setupfile" ),
6672 Distributions : c .StringSlice ("distributions" ),
6773 SkipBuild : c .Bool ("skip_build" ),
74+ DistDir : c .String ("dist_dir" ),
6875 }
6976
7077 if err := plugin .Exec (); err != nil {
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package main
33import (
44 "log"
55 "os/exec"
6+ "path/filepath"
67
78 "github.com/pkg/errors"
89)
@@ -15,6 +16,7 @@ type Plugin struct {
1516 SetupFile string
1617 Distributions []string
1718 SkipBuild bool
19+ DistDir string
1820}
1921
2022func (p Plugin ) buildCommand () * exec.Cmd {
@@ -40,7 +42,7 @@ func (p Plugin) uploadCommand() *exec.Cmd {
4042 args = append (args , p .Username )
4143 args = append (args , "--password" )
4244 args = append (args , p .Password )
43- args = append (args , "dist /*" )
45+ args = append (args , filepath . Join ( p . DistDir , " /*") )
4446
4547 return exec .Command ("twine" , args ... )
4648}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ func TestPublish(t *testing.T) {
1717 SetupFile : "testdata/setup.py" ,
1818 Distributions : strings .Split (os .Getenv ("PLUGIN_DISTRIBUTIONS" ), " " ),
1919 SkipBuild : false ,
20+ DistDir : "dist/" ,
2021 }
2122 err := plugin .Exec ()
2223 if err != nil {
You can’t perform that action at this time.
0 commit comments