From 7a44ca3d895cb1e3eea8ae350ee293f23edf41ff Mon Sep 17 00:00:00 2001 From: "Mikubill.dev" <31246794+Mikubill@users.noreply.github.com> Date: Thu, 14 Apr 2022 08:48:27 +0000 Subject: [PATCH] ci: minor fix --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 4 ++-- cmd/controller.go | 13 +++++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1e5e06..d092d82 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: - name: install uses: actions/setup-go@v1 with: - go-version: 1.14.x + go-version: 1.18.x - name: checkout uses: actions/checkout@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b58abae..2f739a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.18 - name: Run GoReleaser diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f2d9ce..bde38c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: - name: install uses: actions/setup-go@v1 with: - go-version: 1.14.x + go-version: 1.18.x - name: checkout uses: actions/checkout@v1 @@ -19,7 +19,7 @@ jobs: - name: test - default run: | - ./ci-test-linux-amd64 --no-progress -o test -f $(./ci-test-linux-amd64 --silent go.sum) + ./ci-test-linux-amd64 --no-progress -o test -f $(./ci-test-linux-amd64 cat --silent go.sum) cmp test go.sum - name: test - multi diff --git a/cmd/controller.go b/cmd/controller.go index 9f6286c..092d8d3 100644 --- a/cmd/controller.go +++ b/cmd/controller.go @@ -94,8 +94,17 @@ func runner(backend apis.BaseBackend) func(cmd *cobra.Command, args []string) { } } - for _, item := range args { - if !inList(links, item) && !inList(file, item) && !strings.HasPrefix(item, "-") { + for k, item := range args { + isCommand := false + if strings.HasPrefix(item, "-") { + isCommand = true + } + if k > 1 { + if strings.HasPrefix(args[k-1], "-") { + isCommand = true + } + } + if !inList(links, item) && !inList(file, item) && !isCommand { fmt.Printf("transfer: %s: No such file, link or directory\n", item) } }