This is an automated email from the ASF dual-hosted git repository.

msciabarra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/openserverless-cli.git

commit 84027654854fd274e79c9fcfb645b72207a8af27
Author: Michele Sciabarra <[email protected]>
AuthorDate: Sat Jul 27 17:58:51 2024 +0200

    fixed tests
---
 main.go                  | 16 +++++++---------
 tests/update_branch.bats |  4 ++--
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/main.go b/main.go
index ea82eb2..5aa4f59 100644
--- a/main.go
+++ b/main.go
@@ -132,15 +132,13 @@ func Main() {
        // Check if olaris exists. If not, run `-update` to auto setup
        olarisDir := joinpath(joinpath(nuvHome, getNuvBranch()), "olaris")
        if !isDir(olarisDir) {
-               if !(len(os.Args) == 2 && os.Args[1] == "-update") {
-                       log.Println("Welcome to nuv! Setting up...")
-                       dir, err := pullTasks(true, true)
-                       if err != nil {
-                               log.Fatalf("error: %v", err)
-                       }
-                       if err := setNuvOlarisHash(dir); err != nil {
-                               warn("unable to set NUV_OLARIS...", err.Error())
-                       }
+               log.Println("Welcome to nuv! Setting up...")
+               dir, err := pullTasks(true, true)
+               if err != nil {
+                       log.Fatalf("error: %v", err)
+               }
+               if err := setNuvOlarisHash(dir); err != nil {
+                       warn("unable to set NUV_OLARIS...", err.Error())
                }
        }
 
diff --git a/tests/update_branch.bats b/tests/update_branch.bats
index 4cae448..dd679b1 100644
--- a/tests/update_branch.bats
+++ b/tests/update_branch.bats
@@ -19,7 +19,7 @@ setup() {
     load 'test_helper/bats-support/load'
     load 'test_helper/bats-assert/load'
     export NO_COLOR=1
-    export NUV_BRANCH=$(cat ../branch.txt)
+    export NUV_BRANCH="$(cat ../branch.txt)"
     rm -rf ~/.nuv
     run nuv -update
     cd ~/.nuv/$NUV_BRANCH/olaris
@@ -35,5 +35,5 @@ setup() {
     assert_success
 
     run git status
-    assert_line "Your branch is up to date with 'origin/3.0.0-testing'."
+    assert_line --partial "Your branch is up to date with" 
 }

Reply via email to