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

Add ability to manipulate files #1446

Open
iilyak opened this issue Dec 27, 2023 · 1 comment
Open

Add ability to manipulate files #1446

iilyak opened this issue Dec 27, 2023 · 1 comment
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@iilyak
Copy link

iilyak commented Dec 27, 2023

I am using task to write package installers. Specifically to install gitea on macos. I know I am using task outside of its design scope. But it is easier to use than ansible or chief. Specifically the tasks at hand which I am dealing with and missing support from "task". I know I can do it via shell commands but it wouldn't be portable.

  • render go template to a file (and set permission and ownership)
    • template either from literal in Taskfile or from a given location on disk
    • bonus point if I can render into memory and compare the existing file content. Multiple merging strategies:
      • fail if different
      • skip if the same
      • merge if there are no merge conflicts
  • remove literal line (rendered template) from the file if it is present
  • add line to a file if it is not already present
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Dec 27, 2023
@thetanil
Copy link

thetanil commented Jan 1, 2024

I use this kind of feature pretty often in ansible. I think all of them support template string literals or files in some way. In Ansible they are broken into three related modules, the third being blocks in a file, not just a line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

3 participants