Compare commits

..

4 Commits

Author SHA1 Message Date
Andrey Nering
6cb0a5a2f2 v3.43.2 2025-04-21 16:35:01 -03:00
Andrey Nering
08056924e0 chore: add changelog entry for #2191 2025-04-21 16:33:30 -03:00
Valentin Maerten
39706105e1 fix: CLI_ARGS is a string and not an array (#2191) 2025-04-21 16:31:18 -03:00
Andrey Nering
bf4e7960cb chore: show right version on changelog 2025-04-21 14:31:25 -03:00
8 changed files with 26 additions and 11 deletions

View File

@@ -1,6 +1,11 @@
# Changelog # Changelog
## v3.43.0 - 2025-04-21 ## v3.43.2 - 2025-04-21
- Fixed regresion of `CLI_ARGS` being exposed as the wrong type (#2190, #2191 by
@vmaerten).
## v3.43.1 - 2025-04-21
- Significant improvements were made to the watcher. We migrated from - Significant improvements were made to the watcher. We migrated from
[watcher](https://github.com/radovskyb/watcher) to [watcher](https://github.com/radovskyb/watcher) to

View File

@@ -13,24 +13,24 @@ import (
// Get fetches the remaining arguments after CLI parsing and splits them into // Get fetches the remaining arguments after CLI parsing and splits them into
// two groups: the arguments before the double dash (--) and the arguments after // two groups: the arguments before the double dash (--) and the arguments after
// the double dash. // the double dash.
func Get() ([]string, []string, error) { func Get() ([]string, string, error) {
args := pflag.Args() args := pflag.Args()
doubleDashPos := pflag.CommandLine.ArgsLenAtDash() doubleDashPos := pflag.CommandLine.ArgsLenAtDash()
if doubleDashPos == -1 { if doubleDashPos == -1 {
return args, nil, nil return args, "", nil
} }
var quotedCliArgs []string var quotedCliArgs []string
for _, arg := range args[doubleDashPos:] { for _, arg := range args[doubleDashPos:] {
quotedCliArg, err := syntax.Quote(arg, syntax.LangBash) quotedCliArg, err := syntax.Quote(arg, syntax.LangBash)
if err != nil { if err != nil {
return nil, nil, err return nil, "", err
} }
quotedCliArgs = append(quotedCliArgs, quotedCliArg) quotedCliArgs = append(quotedCliArgs, quotedCliArg)
} }
return args[:doubleDashPos], quotedCliArgs, nil return args[:doubleDashPos], strings.Join(quotedCliArgs, " "), nil
} }
// Parse parses command line argument: tasks and global variables // Parse parses command line argument: tasks and global variables

View File

@@ -76,7 +76,7 @@ func run() error {
if err != nil { if err != nil {
return err return err
} }
_, args, err := args.Get() args, _, err := args.Get()
if err != nil { if err != nil {
return err return err
} }

View File

@@ -1 +1 @@
3.43.1 3.43.2

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "@go-task/cli", "name": "@go-task/cli",
"version": "3.43.1", "version": "3.43.2",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "@go-task/cli", "name": "@go-task/cli",
"version": "3.43.1", "version": "3.43.2",
"description": "A task runner / simpler Make alternative written in Go", "description": "A task runner / simpler Make alternative written in Go",
"scripts": { "scripts": {
"postinstall": "go-npm install", "postinstall": "go-npm install",

View File

@@ -5,7 +5,12 @@ sidebar_position: 14
# Changelog # Changelog
## v3.43.0 - 2025-04-21 ## v3.43.2 - 2025-04-21
- Fixed regresion of `CLI_ARGS` being exposed as the wrong type (#2190, #2191 by
@vmaerten).
## v3.43.1 - 2025-04-21
- Significant improvements were made to the watcher. We migrated from - Significant improvements were made to the watcher. We migrated from
[watcher](https://github.com/radovskyb/watcher) to [watcher](https://github.com/radovskyb/watcher) to

View File

@@ -5,7 +5,12 @@ sidebar_position: 14
# Changelog # Changelog
## v3.43.0 - 2025-04-21 ## v3.43.2 - 2025-04-21
- Fixed regresion of `CLI_ARGS` being exposed as the wrong type (#2190, #2191 by
@vmaerten).
## v3.43.1 - 2025-04-21
- Significant improvements were made to the watcher. We migrated from - Significant improvements were made to the watcher. We migrated from
[watcher](https://github.com/radovskyb/watcher) to [watcher](https://github.com/radovskyb/watcher) to