Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/cmd/package/support/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ func BuildPackage(opts *PackageCreateOptions, outFileName string) (*os.File, err
}

func BuildPackageWithContents(opts *PackageCreateOptions, outFileName string, contents *PackageContents) (*os.File, error) {
// Try and create the output folder
err := os.MkdirAll(opts.OutFolder.Value, os.ModePerm)
if err != nil {
return nil, fmt.Errorf("could not create output directory: %w", err)
}

outFilePath := filepath.Join(opts.OutFolder.Value, outFileName)
outPath, err := filepath.Abs(opts.OutFolder.Value)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/package/zip/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func createRun(cmd *cobra.Command, opts *pack.PackageCreateOptions) error {
fmt.Fprintf(opts.Writer, "\nAutomation Command: %s\n", autoCmd)
}

outFilePath := pack.BuildOutFileName("zip", opts.Id.Value, opts.Version.Value)
outFileName := pack.BuildOutFileName("zip", opts.Id.Value, opts.Version.Value)

zip, err := pack.BuildPackage(opts, outFilePath)
zip, err := pack.BuildPackage(opts, outFileName)
if zip != nil {
pack.PrintPackageCreated(cmd, outputFormat, zip.Name())
}
Expand Down
Loading