Skip to content

make_file ¤

Creates a file and displays it as if we used cat on it.

Parameters¤

  • fn
  • replace: optional replacements to apply (dict)
  • content (the body of the lp block)
  • chmod: optional chmod params

Example¤

LP Source:

 ```json lp mode=make_file fn=/tmp/myfile.json addsrc fmt=mk_console
 {"foo": "bar"}
 ```

Result:

$ cat /tmp/myfile.json
{
    "foo": "bar"
}

The file has been created:

$ ls -lta /tmp/myfile.json
-rw-rw---- 1 runner docker 20 Oct  4 21:03 /tmp/myfile.json