forked from Plemya-x/ALR
		
	Merge pull request 'fix: use shell.Fields instead strings.Fields' (#21) from Maks1mS/ALR:fix/use-shell-fields into master
Reviewed-on: Plemya-x/ALR#21
This commit is contained in:
		| @@ -35,6 +35,7 @@ import ( | |||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| 	// Импортируем пакеты для поддержки различных форматов пакетов (APK, DEB, RPM и ARCH). | 	// Импортируем пакеты для поддержки различных форматов пакетов (APK, DEB, RPM и ARCH). | ||||||
|  |  | ||||||
| 	_ "github.com/goreleaser/nfpm/v2/apk" | 	_ "github.com/goreleaser/nfpm/v2/apk" | ||||||
| 	_ "github.com/goreleaser/nfpm/v2/arch" | 	_ "github.com/goreleaser/nfpm/v2/arch" | ||||||
| 	_ "github.com/goreleaser/nfpm/v2/deb" | 	_ "github.com/goreleaser/nfpm/v2/deb" | ||||||
| @@ -42,6 +43,7 @@ import ( | |||||||
| 	"github.com/leonelquinteros/gotext" | 	"github.com/leonelquinteros/gotext" | ||||||
| 	"mvdan.cc/sh/v3/expand" | 	"mvdan.cc/sh/v3/expand" | ||||||
| 	"mvdan.cc/sh/v3/interp" | 	"mvdan.cc/sh/v3/interp" | ||||||
|  | 	"mvdan.cc/sh/v3/shell" | ||||||
| 	"mvdan.cc/sh/v3/syntax" | 	"mvdan.cc/sh/v3/syntax" | ||||||
|  |  | ||||||
| 	"github.com/goreleaser/nfpm/v2" | 	"github.com/goreleaser/nfpm/v2" | ||||||
| @@ -534,7 +536,10 @@ func executeFunctions(ctx context.Context, dec *decoder.Decoder, dirs types.Dire | |||||||
| 			return nil, err | 			return nil, err | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		contents := strings.Fields(strings.TrimSpace(buf.String())) | 		contents, err := shell.Fields(buf.String(), func(s string) string { return "" }) | ||||||
|  | 		if err != nil { | ||||||
|  | 			return nil, err | ||||||
|  | 		} | ||||||
| 		output.Contents = &contents | 		output.Contents = &contents | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user