cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
5.02k stars 287 forks source link

cuelang.org: preprocessor: enable shell aliases in script blocks #3390

Open jpluscplusm opened 3 weeks ago

jpluscplusm commented 3 weeks ago

What page were you looking at?

https://cl-1199888-1--cue-cls.netlify.app/examples/aliases-dont-work/

What version of the site were you looking at?

https://github.com/cue-lang/cuelang.org/commit/de45fd542329b7bc024d95bf8bea925fd87cb5ef via https://cuelang.org/cl/1199888

What did you do?

I tried to use an alias inside a script block.

The motivation for this was to demonstrate a cue command invocation like this:

Hidden block:

alias cue='go run cuelang.org/go/cmd/cue@master'

Visible block:

$ go install cuelang.org/go/cmd/cue@master
$ cue version
<some pseudo-version>

What did you expect?

That the alias would work.

What did you see instead?

image

myitcv commented 3 weeks ago

I would just sidestep the problem:

# hidden
export GOBIN=/tmp/goinstall
export PATH=/tmp/goinstall:$PATH

# not hidden
go install cuelang.org/go/cmd/cue@master
cue version