Merge pull request #26 from TomVasile/upload-from-nested

include option for nested dist
This commit is contained in:
Brad Rydzewski
2020-05-11 11:05:03 -07:00
committed by GitHub
3 changed files with 11 additions and 1 deletions
+7
View File
@@ -52,6 +52,12 @@ func main() {
Usage: "skip build and only upload pre-build packages",
EnvVar: "PLUGIN_SKIP_BUILD",
},
cli.StringFlag{
Name: "dist_dir",
Usage: "used when distribution directory is not in build root",
Value: "dist/",
EnvVar: "PLUGIN_DIST_DIR",
},
}
app.Run(os.Args)
@@ -65,6 +71,7 @@ func run(c *cli.Context) {
SetupFile: c.String("setupfile"),
Distributions: c.StringSlice("distributions"),
SkipBuild: c.Bool("skip_build"),
DistDir: c.String("dist_dir"),
}
if err := plugin.Exec(); err != nil {
+3 -1
View File
@@ -3,6 +3,7 @@ package main
import (
"log"
"os/exec"
"path/filepath"
"github.com/pkg/errors"
)
@@ -15,6 +16,7 @@ type Plugin struct {
SetupFile string
Distributions []string
SkipBuild bool
DistDir string
}
func (p Plugin) buildCommand() *exec.Cmd {
@@ -40,7 +42,7 @@ func (p Plugin) uploadCommand() *exec.Cmd {
args = append(args, p.Username)
args = append(args, "--password")
args = append(args, p.Password)
args = append(args, "dist/*")
args = append(args, filepath.Join(p.DistDir, "/*"))
return exec.Command("twine", args...)
}
+1
View File
@@ -17,6 +17,7 @@ func TestPublish(t *testing.T) {
SetupFile: "testdata/setup.py",
Distributions: strings.Split(os.Getenv("PLUGIN_DISTRIBUTIONS"), " "),
SkipBuild: false,
DistDir: "dist/",
}
err := plugin.Exec()
if err != nil {