XR for Universal Blue and Fedora Atomic Desktops
vr fedora-atomic linux
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

debug: upload debug files for sharing

+11 -29
+11 -29
src/atomic-xr/_debug.nu
··· 5 5 6 6 export def main [ 7 7 output?: path 8 - --base64 # Output base64 instead of creating a file 9 8 --full (-f) # Include extra debug information 10 9 ] { 11 - let output = $output | default (mktemp -t --suffix .msgpackz) | path expand 10 + let output = $output | default (mktemp -t --suffix .yaml) | path expand 12 11 13 12 log info "Gathering debug information" 14 13 ··· 87 86 } 88 87 } 89 88 } 90 - | to msgpackz 91 - | if $base64 { 92 - print (ansi cyan) 93 - $in | encode base64 | print 94 - print (ansi reset) 95 - } else { 96 - save -f $output 97 - log info $"Successfully created debug file. It has been saved to ($output)" 98 - } 89 + | to yaml 90 + | save -f $output 91 + log info $"Successfully created debug file. It has been saved to ($output)" 99 92 100 - if $base64 { 101 - log info $"If you'd like to check what info that contains, use `axr _debug decode --base64 {base64}`" 102 - } else { 103 - log info $"If you'd like to check what info it contains, use `axr _debug decode ($output)`" 93 + const options = [ 94 + "Yes (1h expiry)" 95 + "No" 96 + ] 97 + if ($options | input list -i "Would you like to upload the debug file for sharing?") == 0 { 98 + let link = http post https://minb.in/ (open $output) 99 + print $"Use this link to share your debug file, it will expire in 1 hour: (ansi cyan)($link)(ansi reset)" 104 100 } 105 101 } 106 - 107 - export def decode [ 108 - input # Base64 or file to decode 109 - --base64 110 - --explore (-e) # Explore output 111 - ] { 112 - if $base64 { 113 - $input | decode base64 114 - } else { 115 - open $input 116 - } 117 - | from msgpackz 118 - | if $explore {explore} else {$in} 119 - }