Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: a function to load file content as string #2508

Closed
begoon opened this issue Dec 7, 2024 · 5 comments
Closed

Feature request: a function to load file content as string #2508

begoon opened this issue Dec 7, 2024 · 5 comments

Comments

@begoon
Copy link
Contributor

begoon commented Dec 7, 2024

For example:

TAG := trim(file_content("TAG.txt"))

docker-push:
	docker push ...:{{VERSION}}

Proposed PR: #2507

@laniakea64
Copy link
Contributor

Why not use cat? -

TAG := trim(`cat TAG.txt`)

docker-push:
	docker push ...:{{VERSION}}

@begoon
Copy link
Contributor Author

begoon commented Dec 7, 2024 via email

@begoon
Copy link
Contributor Author

begoon commented Dec 7, 2024

Also, cat may not be available on Windows.

@casey
Copy link
Owner

casey commented Dec 10, 2024

Merged in #2507 as read_to_string(path). Perhaps we should change it to just read(path) before the next release? I originally intended the name to be more verbose to be more explicit, but in reality, just only has strings, so there's no way the function can return anything else.

@casey
Copy link
Owner

casey commented Dec 10, 2024

Renamed to read(path) in #2518.

@casey casey closed this as completed Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants