~chimo/dotfiles

3a37c56a9534efc3a914e3b5e4c6b03688d33c57 — chimo 2 months ago 38d49d8
Revert ".local/bin: pinta file redirection."

From commit 777628357a7a0e6c7f8b77e857d55523808e28c4.

Turns out pinta can't read from stdin.
1 files changed, 20 insertions(+), 1 deletions(-)

M .local/bin/libs/pinta.sh
M .local/bin/libs/pinta.sh => .local/bin/libs/pinta.sh +20 -1
@@ 11,7 11,26 @@ else
    # ex: "foo.sh" to "/home/samsepi0l/foo.sh"
    filepath=$(readlink -f -- "${file}")

    # Grab the resulting directory
    # ex: "/home/samsepi0l/foo.sh" to "/home/samsepi0l"
    filedir=$(dirname -- "${filepath}")

    # Prefix paths with "/tmp" on the container
    # ex: "/tmp/home/samsepi0l/foo.sh"
    remote_prefix="/tmp"
    remote_dir="${remote_prefix}${filedir}"
    remote_path="${remote_prefix}${filepath}"

    # Create remote directory
    incus exec "${container_name}" -- mkdir -p "${remote_dir}"

    # Copy file over
    incus file push -q "${filepath}" "${container_name}${remote_path}"

    # Run
    incus exec "${container_name}" -- sh -c "pinta -" < "${filepath}"
    incus exec "${container_name}" -- sh -c "pinta ${remote_path}"

    # Cleanup
    incus exec "${container_name}" -- sh -c "rm -fr ${remote_dir}"
fi