From 7b1d5762cf0b39dc9bee5c58ca7fd25d804ad3a0 Mon Sep 17 00:00:00 2001 From: Bahaa Aldeen Ghazal Date: Tue, 10 Dec 2024 16:54:08 +0100 Subject: [PATCH] chore: Improving error message when calling mender-artifact on a device without mender Ticket: MEN-7832 Signed-off-by: Bahaa Aldeen Ghazal --- cli/.gitignore | 1 + cli/artifact.mender | Bin 5120 -> 0 bytes cli/write.go | 11 +++++++---- 3 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 cli/artifact.mender diff --git a/cli/.gitignore b/cli/.gitignore index 084f131b4..8ad23448c 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -2,3 +2,4 @@ artifact_info input.mender.txt test.txt testkey +artifact.mender \ No newline at end of file diff --git a/cli/artifact.mender b/cli/artifact.mender deleted file mode 100644 index 9bbcf8849e660419fe0a59be147c8c6e396e50fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5120 zcmXR*Eh^5;&tsq^FaQEG0|N#S4Fu@4fq}6(ObjA#2vly$pkP2tN5RZ4EiOqc0$LB_ zlS_lWhU7VN&7rftYNfRNqTIw1B`c-e)V!3`A|)NAGDwW(gT*xdg)bMmS#XbmS(1wCg!GQmL>)!=9U&o z$w@$C3{BDu4UAKgOcMu?1=s(Ez_bR>^Jb>z48W)|G&3|XH8ui@8=4pznbA4_Lux={9tm z=C*rTVUCKbK-2%~!Z*Hq{Jiviy~Ou-w@sh^(Dv|baiOj=o9?{2wOd?3Q2EH^?(6z& zHdg1=?|rvqyT|@Tu3>KJp^A=rYJ2J9&K3Jx@p1^_k#8|1;*g(ez#L2JJXxY zq8kj>U2)pA$MEaEkQ7DBxD#tv?5eli^e)=G@5}jR_e>Ax$M5=Cy`SOMM2|q{=+f-; zs<>Y}um9LEBZy}ctH!PAlRn+6=eoL3U19gPNpWX$B#^1tKplK(Q2^MC)J@sEFM`|a8{Sr^S8Y0K7lxE{jS`R4Q=7;Mt1SC0n0q@pyPo*>`OZ$J9@j@oSaB4C2-_ZJn^% zqU-t-cb~(L-oCPxjJ_7_k#L^v@L^f0rBXA@H|lAXIhS&&nXB}i&41#(eEIXMp>;)5 z=QI1?scTvDSN-q$6P-(i{A{-U58r$~N$%X=`G(2Ida56Z1Jla?|I7@t1b8YK_-K%D z;H5XTprwHo;4A^H|FPzOLvzghZ)QB2|7j5y=w>42|4W8kha3c2AC^y<%W=;7nQ61+?-fQ)f2O{F+ZumH4NL9~m5c7TR2WQtnsju=rH&0D z$0C`3H6`bJi{{kD?cMk5^RE4!E$LJ0j+9CNVi9rTcsTzKBP2ba+ /dev/null && mender_snapshot="mender-snapshot"`+ - `; [ $(id -u) -eq 0 ] || sudo_cmd="sudo -S"`+ - `; $sudo_cmd /bin/sh -c "echo `+sshInitMagic+`; $mender_snapshot dump" | cat'`, + `'[ $(id -u) -eq 0 ] || sudo_cmd="sudo -S"`+ + `; if which mender-snapshot 1> /dev/null`+ + `; then $sudo_cmd /bin/sh -c "echo `+sshInitMagic+`; mender-snapshot dump" | cat`+ + `; elif which mender 1> /dev/null`+ + `; then $sudo_cmd /bin/sh -c "echo `+sshInitMagic+`; mender snapshot dump" | cat`+ + `; else echo "Mender not found: Please check that Mender is installed" >&2 &&`+ + `exit 1; fi'`, ) cmd := exec.Command("ssh", args...)