cmd/cue: allow CUE_UPDATE to update cmd/cue/cmd testscript tests

Allow CUE_UPDATE to set testscript.Params.UpdateScripts for the
cmd/cue/cmd/testdata/script testscript tests.

Change-Id: I76ae5e28eaf307c050694f488e0d4d3ef9e39bb2
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8403
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cmd/cue/cmd/common_test.go b/cmd/cue/cmd/common_test.go
index 018531c..d2c7184 100644
--- a/cmd/cue/cmd/common_test.go
+++ b/cmd/cue/cmd/common_test.go
@@ -24,7 +24,7 @@
 
 var _ = errors.Print
 
-var update = flag.Bool("update", false, "update the test files")
+var update = flag.Bool("update", os.Getenv("CUE_UPDATE") != "", "update the test files")
 
 func printConfig(t *testing.T) *errors.Config {
 	t.Helper()