Skip to content

Instantly share code, notes, and snippets.

@amtoine
Created May 6, 2023 08:43
Show Gist options
  • Save amtoine/d3f216b30ff331d1765702172b4eeafc to your computer and use it in GitHub Desktop.
Save amtoine/d3f216b30ff331d1765702172b4eeafc to your computer and use it in GitHub Desktop.
compare HTTP files

compare HTTP files

def "http delta" [
    main: string
    target: string
    --page: bool
] {
    let path = ($nu.temp-path | path join (random uuid))
    mkdir $path

    let main = {url: $main, path: ($path | path join "main")}
    let target = {url: $target, path: ($path | path join "target")}

    http get $main.url --raw | save $main.path
    http get $target.url --raw | save $target.path

    delta --paging (if $page { "always" } else { "never" }) $main.path $target.path
}
http delta https://raw.githubusercontent.com/rafamadriz/friendly-snippets/main/snippets/nushell.json https://raw.githubusercontent.com/nushell/vscode-nushell-lang/main/snippets/nushell.json
http delta https://raw.githubusercontent.com/amtoine/nu-git-manager/main/completions.nu https://raw.githubusercontent.com/nushell/nu_scripts/main/custom-completions/git/git-completions.nu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment