-
Notifications
You must be signed in to change notification settings - Fork 171
Add functions from path/filepath #222
Comments
The need for Once it's decided, I can send a PR for this issue. |
Some functions in "path/filepath" are not in "path", i.e. filepath.Abs() (which I need). |
"Path package should only be used for paths separated by forward slashes, such as the paths in URLs". They are both in the standard library to be used with different paths, and a configuration language like CUE should be able to handle filename paths. |
There is a reason these don't exist yet: So there are two major decisions to be made before this can be added:
There are several benefits to using different package names. Open to other layouts. This should not be too hard to do. The package could be generated using |
I think that would be OK. One somewhat comment; I have desire to import tools from other packages. I know that packages are not fully defined but something to consider especially if we're adding more builtin packages that strictly tool packages. |
If there is not other option.
I would prefer |
There has been an increasing desire to evaluate tool files as data as well. This complicates simply adding such builtins. As their output depends on the environment, they are not hermetic and tools like trim are useless or even dangerous. One way around this would be for these builtins to return some stub (a new internal type or so) that would always return an "incomplete" status by default, but that would become "activated" when running in tool mode. Other than that, I think |
I've found myself needing the OS-specific behaviour in pure CUE. That is to say, I know exactly what OS' behaviour I need in a given situation. Part of the "issue" with
|
These have been added in the Right now, the OS can be passed manually using injection via
|
Leaving this open to also track the addition of the @tag feature. |
For reviewer: tests and naming are the big ticket items to review here. For instance: wd: string @tag(wd,var=cwd) Fixes #222 os-specific filepath functionality available by passing the "os" injection variable as second argument Fixes #135 username: available as the username injection variable see cue help injection Change-Id: I33c04f5f8dff34a1b6a4333a6674b3f36be48d34
For reviewer: tests and naming are the big ticket items to review here. For instance: wd: string @tag(wd,var=cwd) Fixes #222 os-specific filepath functionality available by passing the "os" injection variable as second argument Fixes #135 username: available as the username injection variable see cue help injection Change-Id: I33c04f5f8dff34a1b6a4333a6674b3f36be48d34
For reviewer: tests and naming are the big ticket items to review here. For instance: wd: string @tag(wd,var=cwd) Fixes #222 os-specific filepath functionality available by passing the "os" injection variable as second argument Fixes #135 username: available as the username injection variable see cue help injection Change-Id: I33c04f5f8dff34a1b6a4333a6674b3f36be48d34
For reviewer: tests and naming are the big ticket items to review here. For instance: wd: string @tag(wd,var=cwd) Fixes #222 os-specific filepath functionality available by passing the "os" injection variable as second argument Fixes #135 username: available as the username injection variable see cue help injection Change-Id: I33c04f5f8dff34a1b6a4333a6674b3f36be48d34
For reviewer: tests and naming are the big ticket items to review here. For instance: wd: string @tag(wd,var=cwd) Fixes #222 os-specific filepath functionality available by passing the "os" injection variable as second argument Fixes #135 username: available as the username injection variable see cue help injection Change-Id: I33c04f5f8dff34a1b6a4333a6674b3f36be48d34
For reviewer: tests and naming are the big ticket items to review here. For instance: wd: string @tag(wd,var=cwd) Fixes #222 os-specific filepath functionality available by passing the "os" injection variable as second argument Fixes #135 username: available as the username injection variable see cue help injection Change-Id: I33c04f5f8dff34a1b6a4333a6674b3f36be48d34
For reviewer: tests and naming are the big ticket items to review here. For instance: wd: string @tag(wd,var=cwd) Fixes #222 os-specific filepath functionality available by passing the "os" injection variable as second argument Fixes #135 username: available as the username injection variable see cue help injection Change-Id: I33c04f5f8dff34a1b6a4333a6674b3f36be48d34
This issue has been migrated to cue-lang/cue#222. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Have been added all functions from "path" (https://godoc.org/cuelang.org/go/pkg/path) but I need them from "path/filepath" to be compatible with the target operating system.
For now, what I need is "filepath.Join" and "filepath.IsAbs".
The text was updated successfully, but these errors were encountered: