Skip to content

Commit 9f9ebac

Browse files
committed
cmd/cue: fix error on cue mod rename with a bad module
We weren't printing the error in this case. Signed-off-by: Roger Peppe <[email protected]> Change-Id: Ib8da7ac07c52eeb61c4a983e855919e2b927918f Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1216869 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 90d9b04 commit 9f9ebac

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmd/cue/cmd/modrename.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type modRenamer struct {
6060
func runModRename(cmd *Command, args []string) error {
6161
modFilePath, mf, _, err := readModuleFile()
6262
if err != nil {
63-
return nil
63+
return err
6464
}
6565
if mf.Module == args[0] {
6666
// Nothing to do
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Test that we see an error when the module cannot be loaded
22

3-
# TODO this should be an error
4-
exec cue mod rename other.org
3+
! exec cue mod rename other.org
4+
cmp stderr want-stderr
55

6+
-- want-stderr --
7+
no language version declared in module.cue
68
-- cue.mod/module.cue --
79
// Note: no language version
810
module: "main.org"

0 commit comments

Comments
 (0)