···5566export def main [
77 output?: path
88- --base64 # Output base64 instead of creating a file
98 --full (-f) # Include extra debug information
109] {
1111- let output = $output | default (mktemp -t --suffix .msgpackz) | path expand
1010+ let output = $output | default (mktemp -t --suffix .yaml) | path expand
12111312 log info "Gathering debug information"
1413···8786 }
8887 }
8988 }
9090- | to msgpackz
9191- | if $base64 {
9292- print (ansi cyan)
9393- $in | encode base64 | print
9494- print (ansi reset)
9595- } else {
9696- save -f $output
9797- log info $"Successfully created debug file. It has been saved to ($output)"
9898- }
8989+ | to yaml
9090+ | save -f $output
9191+ log info $"Successfully created debug file. It has been saved to ($output)"
9992100100- if $base64 {
101101- log info $"If you'd like to check what info that contains, use `axr _debug decode --base64 {base64}`"
102102- } else {
103103- log info $"If you'd like to check what info it contains, use `axr _debug decode ($output)`"
9393+ const options = [
9494+ "Yes (1h expiry)"
9595+ "No"
9696+ ]
9797+ if ($options | input list -i "Would you like to upload the debug file for sharing?") == 0 {
9898+ let link = http post https://minb.in/ (open $output)
9999+ print $"Use this link to share your debug file, it will expire in 1 hour: (ansi cyan)($link)(ansi reset)"
104100 }
105101}
106106-107107-export def decode [
108108- input # Base64 or file to decode
109109- --base64
110110- --explore (-e) # Explore output
111111-] {
112112- if $base64 {
113113- $input | decode base64
114114- } else {
115115- open $input
116116- }
117117- | from msgpackz
118118- | if $explore {explore} else {$in}
119119-}