-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue: add language version in "mod init"
We want the language version to be reflected in the module file. Also check that `cue mod tidy` is a no-op after running `cue mod init`. Fixes #2808. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I31339c34f6f26175a6b04fb0431238c88d413725 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1177110 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
3 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Check that cue mod init adds the language version. | ||
env CUE_VERSION_OVERRIDE=v0.1.2 | ||
exec cue mod init foo.example | ||
cmp cue.mod/module.cue want-module | ||
|
||
# cue mod tidy should be a no-op after cue mod init | ||
exec cue mod tidy | ||
cmp cue.mod/module.cue want-module | ||
|
||
-- want-module -- | ||
module: "foo.example@v0" | ||
language: { | ||
version: "v0.1.2" | ||
} | ||
-- _registry/example.com_e_v0.0.1/cue.mod/module.cue -- | ||
module: "example.com/e@v0" | ||
-- _registry/example.com_e_v0.0.1/main.cue -- | ||
package e |