Skip to content
Snippets Groups Projects

.jq for absolute file path

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by swym
    Edited
    snippetfile1.txt 349 B
    [.[]|({
        directory:.directory,
        command:(. as {file:$file, directory:$directory}
            |.command
            |sub("-fno-isolate-erroneous-paths-dereference";"-m32")
            |sub("(?<a>\\s)\\.\\./"; (.a) + "\($directory)/../")
            |sub("/build/\\.\\./"; "/")
            )
        ,
        file:((.directory|sub("build$";""))+(.file|sub("^../";"")))
    })]
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment