From 0a21b729789cf5120f6ecca94437d096f746f418 Mon Sep 17 00:00:00 2001 From: Sulaiman AlIbrahim Date: Sun, 23 May 2021 19:41:23 +0300 Subject: [PATCH] Enable operation on non-crate directories, bug fixes, doc fixes The major changes made in this commit are to how Carnet deals with non-crate directories (now permitted instead of immediate failure). Other notable bug fixes and features in this commit: - Print help message when no argument is given. - Only acknowledge the first command as such and treat what follows as normal arguments. - First commit to contain Carnet signatures of itself. --- .carnet/cookies.d/1db590b59b0f72a48d4f.cookie | 1 + .carnet/initialized | 1 + .carnet/owners/1db590b59b0f72a48d4f.cert | 56 ++++++++ .carnet/seal-ignore.list | 8 ++ .carnet/seal/sealed | 1 + .carnet/seal/signatures.sha256 | Bin 0 -> 3077 bytes ...signatures.sha256.1db590b59b0f72a48d4f.sig | Bin 0 -> 1024 bytes .carnet/seal/signatures.sha384 | Bin 0 -> 4101 bytes ...signatures.sha384.1db590b59b0f72a48d4f.sig | Bin 0 -> 1024 bytes ...uhXwWP3KHituntu6prfcumglts1vivVI9bAfw42R3I | Bin 3605 -> 3512 bytes NEWS.en.md | 27 ++++ README.en.md | 2 +- README.md | 4 +- carnet | 122 +++++++++--------- tests/carnet-test.sh | 2 +- 15 files changed, 160 insertions(+), 64 deletions(-) create mode 100644 .carnet/cookies.d/1db590b59b0f72a48d4f.cookie create mode 100644 .carnet/initialized create mode 100644 .carnet/owners/1db590b59b0f72a48d4f.cert create mode 100644 .carnet/seal-ignore.list create mode 100644 .carnet/seal/sealed create mode 100644 .carnet/seal/signatures.sha256 create mode 100644 .carnet/seal/signatures.sha256.1db590b59b0f72a48d4f.sig create mode 100644 .carnet/seal/signatures.sha384 create mode 100644 .carnet/seal/signatures.sha384.1db590b59b0f72a48d4f.sig diff --git a/.carnet/cookies.d/1db590b59b0f72a48d4f.cookie b/.carnet/cookies.d/1db590b59b0f72a48d4f.cookie new file mode 100644 index 0000000..7b44761 --- /dev/null +++ b/.carnet/cookies.d/1db590b59b0f72a48d4f.cookie @@ -0,0 +1 @@ +8ede68df4e3dd1681c59802c diff --git a/.carnet/initialized b/.carnet/initialized new file mode 100644 index 0000000..461f711 --- /dev/null +++ b/.carnet/initialized @@ -0,0 +1 @@ +initialized diff --git a/.carnet/owners/1db590b59b0f72a48d4f.cert b/.carnet/owners/1db590b59b0f72a48d4f.cert new file mode 100644 index 0000000..bf16a1f --- /dev/null +++ b/.carnet/owners/1db590b59b0f72a48d4f.cert @@ -0,0 +1,56 @@ +-----BEGIN CERTIFICATE----- +MIIKCzCCBfOgAwIBAgIUHm8KK+4UUBwo6GKRRXMZE426aKwwDQYJKoZIhvcNAQEM +BQAwgYIxPjA8BgNVBAMMNVN1bGFpbWFuIEEuIEFsSWJyYWhpbSDYs9mE2YrZhdin +2YYg2KfZhNil2KjYsdin2YfZitmFMRwwGgYJKoZIhvcNAQkBFg1zYW1Aa2EuY29t +Lmt3MRUwEwYDVQQKDAxLdXRvbWV0YSBTUEMxCzAJBgNVBAYTAktXMCAXDTIwMTIy +NDA5MDA1OVoYDzIyOTQxMDA5MDkwMDU5WjCBgjE+MDwGA1UEAww1U3VsYWltYW4g +QS4gQWxJYnJhaGltINiz2YTZitmF2KfZhiDYp9mE2KXYqNix2KfZh9mK2YUxHDAa +BgkqhkiG9w0BCQEWDXNhbUBrYS5jb20ua3cxFTATBgNVBAoMDEt1dG9tZXRhIFNQ +QzELMAkGA1UEBhMCS1cwggQiMA0GCSqGSIb3DQEBAQUAA4IEDwAwggQKAoIEAQCo +sY8n9CDVHmlwuu7hkxViu9DunjrXrVjSaVfDpcRbKqHfgrW3RPvKoMai9OVNtdqp +B2nYnM+eYoqaClLXuNaaNmGXELRhw1v4qSr4RvVDXS6m7YWIANDfyvWfDfCbrvlA +ZIzGikxwPO14uB0VtOzOBGXm8LOOHm6tBNlKmIUEwqMTlXSPQ3nMfVQVR74cMdSh +aVxvFKmcG9cCx3q8blTOPFriYm/FnBdEjrV3KUfCoHQvI0OMMyOcB5VaaZdGL33M +dIX8GtmU4PJjxtb5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5Fa46mhsIpTvp+N3h/ju9cHZ4awAIvZC27wnZqO7Ciw+VX9cvjvWtsYtoAfbL +gIYYVwtHFUOz24Pi+wZMkAAuVEBI2pQNG+yEEP5UkzO5EGBnOx3qHFIdOQ9GN5U3 +FzE6JJwE5IGB9jWO6NTPwlHcgFRVyFpqqtvtxZAQLZxR0Vo4gRp8QkjJR6IAwiPP +M4amnYjIzN9Ofi7fRt2ibEoxk6LD6b9avn7iulefjalgyCGEF3TJFQbvy3X2KQUg +ZLQmHyYhIM4XdmTCD6w2NxO6vd8Z4l5tet9DIUybII+wY9vYRbufhVuH6t8EcEqT +uUaMyUtKhpdj3CUCcbyviQa/kR74dcfLEpK39zLu8kxnnCCW+aHnXIVTrIfcsXfV +JeLsGspO3oNqePyEN/X/qwcs07WG+Z+QGADyDp3UXBVObyDHFW1rM2xKNhCzF1Zv +pV9q6v5v9VCyXYoKv1o0omgYkeNRBTd/vzr7ZJCBlgqdw8AjDoZiaWcvggU7hZe3 +EyYBxDzznAccMQ7OZcFR1gGwbAriMHS9nYQXt/bb9g== +-----END CERTIFICATE----- diff --git a/.carnet/seal-ignore.list b/.carnet/seal-ignore.list new file mode 100644 index 0000000..7ff8bf7 --- /dev/null +++ b/.carnet/seal-ignore.list @@ -0,0 +1,8 @@ +/\.git/ +/\.git$ +^\./target/ +^\./\.carnet/seal/ +/\.private-staging-mountpoint/ +/target/ +/Cargo.lock + diff --git a/.carnet/seal/sealed b/.carnet/seal/sealed new file mode 100644 index 0000000..cca29a5 --- /dev/null +++ b/.carnet/seal/sealed @@ -0,0 +1 @@ +sealed diff --git a/.carnet/seal/signatures.sha256 b/.carnet/seal/signatures.sha256 new file mode 100644 index 0000000000000000000000000000000000000000..fb2837a0de990c2b91fd21a513e2d326b08ec44d GIT binary patch literal 3077 zcmZ`*>vogJ4(+4(1?*^Unwg&zLIb6xr8I>8VQEGh=S$)^$959v(|3QsIpna?wZcjO zN78KVi&jUgF1u?x9QEz?a?IbBWA){~7o%zzv9K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F781`* zU{=4_CvxshD+%cM0*jsT4$ao){aWE~`lnvl@UFP>hYh0{Y_)CCEVDTeFbr8J%^*;0 z`RRHPm9C;x0Ofm54(@jPgCQErl~M*9|Cr9VR^^fJ(&Y}M?-Im_gmA>b7VOAkgWTsN zHTa`Q!mIcBOK!r&Y@21esMx)|{2}6+2dYc8UB)#Tci9bzxxj=cw;+zXlMYO_R}e^b uxLL)a%GUQeB-$ddQ&ujA)i9A3D1Q(<2MSk|G^qh+P@4SeM5h?aTPlVfp$g9c literal 0 HcmV?d00001 diff --git a/.carnet/seal/signatures.sha384 b/.carnet/seal/signatures.sha384 new file mode 100644 index 0000000000000000000000000000000000000000..497f9069047f1684c9ab0a845e5a85cace9ceed8 GIT binary patch literal 4101 zcmZ{n*>Y3Y5{C0AdI8C69xe%(kc5PU5Qf}PYv`5*o{l7A$kU&1;} zsTVhVY&n$@RA!ysHI+JIo7r0<-PzI8aL#wlt(r8Ab+L;MEjjnDKBn(B|8Hn_xjXLK z`R;F-tE$~;9UA+nO|mt<<>5^jK4szGORAyk@HP9%cRUaE)ASab3$&E9r<_HG^fKu; zcxTh>rk3a_-}_f(uWm18fB2Un$o{yxZ#=y=o3+|9n@Pb)EU}kP10fpQJ%==|l%5Q; zU|`i+*V4>MX`wk6tILLGq+Ff*s+WVb^Yw0fd9|0#`R;IB1Bi==ZC7N8DJVtY$(rg_jq}~(nEw#6d{d37xv__k@ zIET%XFO}J?coS!AOxUpnwJA?Oj9BeHcRO=ywnwKu6mNCTlxnoGM;7g}OVuR@EGWv# z>{9J|zx&XRvOXN!c6YfwdHDGK^YrLRdOx2&diK-X^$+pw4ii>A(K#25oqw8UH^5AiH(+}FzK&DrbQ zSHJn6pX`n|m&coQz1MMbu{}Q??1$Zlmp|72KyQP4?tff$V@=P=GG2<+syVhXeKEa= zVK_NkjW(6cq@x9VI;I1twbUW5<|%dZvUZ8S%sGprDFwuU$T*wt>+i{Rzj^oO)7ET% zoi~qOJa+c_>Eqv5?4N(9mfG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zd~LA ZB@v-X(J~{HsbD3jE_ZfYx=t(K{TF$dpe_Ia literal 0 HcmV?d00001 diff --git a/.carnet/seal/signatures.sha384.1db590b59b0f72a48d4f.sig b/.carnet/seal/signatures.sha384.1db590b59b0f72a48d4f.sig new file mode 100644 index 0000000000000000000000000000000000000000..c4dcd49cc7d57a5f81f96ae1fbfcb51a218cae13 GIT binary patch literal 1024 zcmV+b1poUAKs`|EUlL$(LkaY+EHTR+vbN64lSYn#P}JMXqYu8WS0{SiCRH;iOxkt; z#py6&R?l=a4Gw9HC>L%>JgA3p%*vk&eadL1iZr9F% z+j9VaI6Btb@J?Q^cSFxMyk_(^yHlMr)+Vykmp<(TwV~BO>cwy^#j0U(Zo55~Xx0DV zhv2T@zVC9hZ}48bAnC}v*+O1RS}!PIZtT~8?g9)|Mj@6R8cDRGkIa%8-X|kf)!Wxi!0!hLlh%jDC9J32@S12(u^j^YGcR8 z9EdxP-52JZ1O(!*%{*>2erlqd!A2FCLTml@z9<{PzXd{XFr@bA@{czy{F`?r8|K!t zWPBTCew@vp%6)1D+F6m*?{Q|hhRJ5CEygP&m>p`@)Q;%C4f4Z9EB{r^2_G=tCKc#z zhkJ!d;c`!?g4|;2Ca6vu_nKAT>lT7KC`qo8-EoS!>=6(`R=NyC2Vo~KdlItmDELDI zKyf9jbB2UJ=5cj8Z|Qi9WoqW};Gm(2o|F`_lT{0`r7>tv(wS=sYv7i%BMHt&4m`#% zaz?}c7^Q>EoD#W|!<|AQ!f`28EL zGDK$$2ulOg+|%35tqpe?eCCqIsGsgTRPJvWZ>VR4L-RpE>OM2oPJ?N6=y@7T@yKNx z3=yShDAfCbmgk*dV1{;@5J9iYqJFD0g?b~>9zB|IUp1Pxl2+ViygcYe_Z66_h@v^( u{)+JNWz!5%lnmI{25gjK{J~9ln_{%fTs4Q&RY17A0+XuL$ef`AxEciZBm55l literal 0 HcmV?d00001 diff --git a/.private-staging/EuhXwWP3KHituntu6prfcumglts1vivVI9bAfw42R3I b/.private-staging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!ts|I?&>kgI>U84tH1ap#Yd9ER6kyA<`j zj~WP7sJi^utVgVaoNuRc|^7@Q;%-3z(@LRPs# z_u)p^INOx+g#mghAIu`_I(%+Su!HLq>M)y(s^(~!imS?0sHiAe6Zk@eMUvpHvQ2j} zs7M7JNq4vpK~|(fAa{!!#M0JKkOz+x&oBJGCL^0uo0l=;&R zUZms#b=Til4(EYG_8|Fznr{E6XV2#FcVz14D6-5`3e~M>3|gddZ&C-dok@FEVUNA8 ze<0(X;m7+rZRxeA$9+Hx7~V;wupQFRn_P3D*ea7-8~LlhyuwZfO4FJs-Xj!CqG3UD zT=j$wEh=_d)0&fdoeGM8M$eswT$RLWGORh7CbaYtm_tEr?fQDC^HmE7Oo+YL7xi8A z#Ti?EPT7VS0i~Xs9K%=VZY6NinK;4^nVF0G9D2N0mEI&^HIHH~g!v}xqwDAVpGroz zPhW^T3^uw&@wPp>^4y+a5MOAH=YTT?fqIOvaNRvAW6vd7FYA-_d=^ZzI}0?UaJc#E zHL8E)$)hlhX!%t15Og)wWO$pdTrBMFF_a8wF-3_t`(Vq~yx9lip)9YuC7Z&SmLBv_r>d)!e&|mZ&AA zI0ymc6XO`NVm#V1N3^7!8l%F8pi>5G+M|qt^(kgs-loqaqskr^V*jQtIM8*e{$d&6 zYW6R}9rG8)*&ZD<4gw6MpsC3wb})YNUhJ+=Gl+2^DI`n0PIBq*DMD&pLJyaHarG4f zG#@=+B;PJJKj*81K=*ti8ek31t1UqHvz@K}-RA1uTSRH>?)Vd&ljzNmt)eN85uXq$ b(peSOZZU|z*h}Pvg)e!17C*FjKzH(LkmCrY diff --git a/NEWS.en.md b/NEWS.en.md index 53b0f1a..f0b4957 100644 --- a/NEWS.en.md +++ b/NEWS.en.md @@ -4,6 +4,33 @@ This file documents noteworthy changes between each version of Carnet. +### Noteworthy changes in v0.3.4 (2021-05-23) + +This release contains last minute changes prior to project +announcement. + +##### Breaking Changes + +* None that we're aware of. + +##### New Features + +* Improved CLI ergonomics by showing expected help message when no + arguments are given +* Initializing, sealing, and verifying non-crate directories is now + permitted +* Improved documentation: The carnet:files command is now mentioned + in --carnet:help +* Improved Error messages +* Dogfooding from now on: The Carnet repository is now being signed + using Carnet. + +##### Bug Fixes + +* Fixed argument parsing bugs + + + ### Noteworthy changes in v0.3.3 (2021-05-21) This is the first publicly-released version of Carnet. diff --git a/README.en.md b/README.en.md index 5391f94..e2c3542 100644 --- a/README.en.md +++ b/README.en.md @@ -1,2 +1,2 @@ The English version of the README file is currently located in -[README.md](README.md). It will be moved here later. +[README.md](README.md). It will be moved back here later. diff --git a/README.md b/README.md index 2adb906..1da98f3 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ > life-cycle management are WIH. Carnet is a small tool that imposes additional security constraints -on Rust's official package manager, Cargo. This tool aims to prevent -or otherwise limit the damage malicious crates can cause. +on Rust's official package manager, Cargo. It aims to prevent or +otherwise limit the damage malicious crates can cause. Carnet imposes two types of security constraints on Cargo: diff --git a/carnet b/carnet index abd6848..38600a8 100755 --- a/carnet +++ b/carnet @@ -3,14 +3,13 @@ PROJECT_NAME="carnet" PROJECT_TITLE="Carnet: Bureaucracy for Cargo" - PROJECT_VERSION="0.3.3" + PROJECT_VERSION="0.3.4" PROJECT_DATE="2021-05-21" COPYRIGHT="Copyright © 2021 Kutometa SPC, Kuwait" DESCRIPTION="Carnet is a small tool that imposes additional security constraints on Rust's official package - manager, Cargo. This tool aims to prevent or - otherwise limit the damage malicious crates can - cause." + manager, Cargo. It aims to prevent or otherwise + limit the damage malicious crates can cause." COPYRIGHT_BLURB=" $PROJECT_NAME $PROJECT_VERSION $COPYRIGHT @@ -177,7 +176,7 @@ ${BOLD-}USAGE${RESET-} carnet [OPTIONS] [CARGO COMMANDS & OPTIONS] carnet [OPTIONS] [CARNET COMMAND] - + ${BOLD-}GENERAL OPTIONS${RESET-} --carnet:config-dir=... Override default configuration @@ -207,8 +206,7 @@ ${BOLD-}SANDBOX OPTIONS${RESET-} ${BOLD-}AUTHENTICATION OPTIONS${RESET-} --carnet:disable-verification Disable automatic verification. - See carnet:edit and carnet:done. - + See carnet:edit and carnet:done. ${BOLD-}COMMANDS${RESET-} @@ -216,6 +214,7 @@ ${BOLD-}COMMANDS${RESET-} carnet:sandbox-run Run arbitrary commands in sandbox. carnet:seal Seal current crate. carnet:verify Verify current crate. + carnet:files View all files that get sealed. carnet:own Set origin of current as local. carnet:disown Set origin of current crate as foreign. carnet:distrust Unregister the current crate from cache. @@ -1203,7 +1202,7 @@ locate_known_crate_from_the_inside_and_set_up_global_variables() { break fi if [[ "$( realpath -- "$KNOWN_CRATE_PATH" )" == "/" ]]; then - debug "Could not find Cargo.toml in this directory or any of its parents.\n" + debug "Could not find a crate in this directory or any of its parents.\n" unset KNOWN_CRATE_PATH unset KNOWN_CRATE_PATH_HASH unset KNOWN_CRATE_ORIGIN @@ -1430,65 +1429,62 @@ for arg in "$@"; do elif [[ "$END_OF_OPTIONS" == "no" ]] && [[ "$arg" =~ ^--rw-paths= ]]; then SANDBOX_RW_PATHS="${arg:11}" - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "--$PROJECT_NAME:help" ]] || [[ "$arg" == "$PROJECT_NAME:help" ]] ) ; then - COMMAND="help" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "--$PROJECT_NAME:help" ]] || [[ "$arg" == "$PROJECT_NAME:help" ]] ) ; then + if ! [[ "${COMMAND}" ]]; then COMMAND="help"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "--help" ]] || [[ "$arg" == "help" ]] || [[ "$arg" == "-h" ]]) ; then - COMMAND="cargo-help" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "--help" ]] || [[ "$arg" == "help" ]] || [[ "$arg" == "-h" ]]) ; then + if ! [[ "${COMMAND}" ]]; then COMMAND="cargo-help"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:sandbox-run" ]] || [[ "$arg" == "sandbox-run" ]] ); then - COMMAND="sandbox-run" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:sandbox-run" ]] || [[ "$arg" == "sandbox-run" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="sandbox-run"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:seal" ]] || [[ "$arg" == "seal" ]] ); then - COMMAND="seal" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:seal" ]] || [[ "$arg" == "seal" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="seal"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:disable" ]] || [[ "$arg" == "disable" ]] ); then - COMMAND="disable" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:disable" ]] || [[ "$arg" == "disable" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="disable"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:enable" ]] || [[ "$arg" == "enable" ]] ); then - COMMAND="enable" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:enable" ]] || [[ "$arg" == "enable" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="enable"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:verify" ]] || [[ "$arg" == "verify" ]] ); then - COMMAND="verify" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:verify" ]] || [[ "$arg" == "verify" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="verify"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:owners" ]] || [[ "$arg" == "owners" ]] ); then - COMMAND="list-owners" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:owners" ]] || [[ "$arg" == "owners" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="list-owners"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:files" ]] || [[ "$arg" == "files" ]] ); then - COMMAND="list-seal-files" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:files" ]] || [[ "$arg" == "files" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="list-seal-files"; fi - #elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:bash-embedable" ]] || [[ "$arg" == "bash-embedable" ]] ); then - # COMMAND="generate-bash-embedable" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:own" ]] || [[ "$arg" == "own" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="own"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:own" ]] || [[ "$arg" == "own" ]] ); then - COMMAND="own" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:disown" ]] || [[ "$arg" == "disown" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="disown"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:disown" ]] || [[ "$arg" == "disown" ]] ); then - COMMAND="disown" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:distrust" ]] || [[ "$arg" == "distrust" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="distrust"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:distrust" ]] || [[ "$arg" == "distrust" ]] ); then - COMMAND="distrust" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:init" ]] || [[ "$arg" == "init" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="init"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:init" ]] || [[ "$arg" == "init" ]] ); then - COMMAND="init" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:uninit" ]] || [[ "$arg" == "uninit" ]] ) ; then + if ! [[ "${COMMAND}" ]]; then COMMAND="uninit"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:uninit" ]] || [[ "$arg" == "uninit" ]] ) ; then - COMMAND="uninit" - - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:identity" ]] || [[ "$arg" == "identity" ]] ); then - COMMAND="identity" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:identity" ]] || [[ "$arg" == "identity" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="identity"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "--$PROJECT_NAME:version" ]] || [[ "$arg" == "--version" ]] ); then - COMMAND="version" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "--$PROJECT_NAME:version" ]] || [[ "$arg" == "--version" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="version"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "--$PROJECT_NAME:legal" ]] || [[ "$arg" == "--legal" ]] ); then - COMMAND="legal" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "--$PROJECT_NAME:legal" ]] || [[ "$arg" == "--legal" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="legal"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:edit" ]] || [[ "$arg" == "edit" ]] ); then - COMMAND="edit" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:edit" ]] || [[ "$arg" == "edit" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="edit"; fi - elif [[ "$END_OF_OPTIONS" == "no" ]] && ( [[ "$arg" == "$PROJECT_NAME:done" ]] || [[ "$arg" == "done" ]] ); then - COMMAND="done" + elif [[ "$END_OF_OPTIONS" == "no" ]] && ! [[ "${COMMAND}" ]] && ( [[ "$arg" == "$PROJECT_NAME:done" ]] || [[ "$arg" == "done" ]] ); then + if ! [[ "${COMMAND}" ]]; then COMMAND="done"; fi elif [[ "$END_OF_OPTIONS" == "no" ]] && [[ "$arg" == "--$PROJECT_NAME:end" ]]; then END_OF_OPTIONS="yes" @@ -1515,7 +1511,9 @@ if ! [[ "${CARGO_PATH-}" ]]; then } fi -if [[ "$COMMAND" == "cargo-help" ]]; then +debug "Carnet command selected was '$COMMAND'. If empty, this means that this is a direct cargo pass though."; + +if [[ "$COMMAND" == "cargo-help" ]] || [[ "$#" -eq 0 ]]; then # TODO sandbox "$CARGO_PATH" "help" printf "%s\n\n" "See '$PROJECT_NAME $PROJECT_NAME:help' or '$PROJECT_NAME --$PROJECT_NAME:help' for more information about options and commands that are specific to carnet." @@ -1738,12 +1736,15 @@ if [[ "$COMMAND" ]]; then KNOWN_CRATE_PATH="." locate_known_crate_from_the_inside_and_set_up_global_variables crate_root="${UNHANDLED_NON_OPTIONS[0]:-.}" + if ! [[ -d "$crate_root" ]]; then + fatal "'$crate_root' is not a directory" + fi if ! [[ -f "$crate_root/Cargo.toml" ]]; then - fatal "'$crate_root' doesn't seem to be a rust crate (no Cargo.toml)" + warn "'$crate_root' doesn't seem to be a rust crate (no Cargo.toml). Proceeding anyway." fi - initialize_crate "${UNHANDLED_NON_OPTIONS[0]:-.}" - trust_crate "${UNHANDLED_NON_OPTIONS[0]:-.}" - own_crate "${UNHANDLED_NON_OPTIONS[0]:-.}" + initialize_crate "$crate_root" + trust_crate "$crate_root" + own_crate "$crate_root" elif [[ "$COMMAND" == "uninit" ]]; then KNOWN_CRATE_PATH="." locate_known_crate_from_the_inside_and_set_up_global_variables @@ -1821,15 +1822,16 @@ else sandbox "$CARGO_PATH" "${FILTERED_ARGS[@]}" || exit "$?" if ! [[ "${UNHANDLED_NON_OPTIONS[1]-}" ]] || ! [[ -f "${UNHANDLED_NON_OPTIONS[1]}/Cargo.toml" ]]; then - fatal "Your new crate has been successfully setup by cargo, \ - but carnet could not initialize it automatically because \ - it couldn't find the new directory \ - '${UNHANDLED_NON_OPTIONS[1]-}'. You can initialize your \ - crate manually by running $PROJECT_NAME carnet:init inside your crate." + fatal "Carnet has failed to setup your new crate properly. You can try to use cargo directly and then run $PROJECT_NAME carnet:init manually inside your new crate. Please consider reporting this issue if you can reproduce it." + Please consider reporting this issue. fi initialize_crate "${UNHANDLED_NON_OPTIONS[1]}" trust_crate "${UNHANDLED_NON_OPTIONS[1]}" own_crate "${UNHANDLED_NON_OPTIONS[1]}" + + if ! [[ "${UNHANDLED_NON_OPTIONS[1]-}" ]] || ! [[ -d "${UNHANDLED_NON_OPTIONS[1]}/.carnet" ]]; then + fatal "Carnet has failed to setup your new crate properly. Try to run $PROJECT_NAME carnet:init manually inside your new crate. Please consider reporting this issue if you can reproduce it." + fi elif [[ "${UNHANDLED_NON_OPTIONS[0]-}" == "version" ]]; then echo "$PROJECT_NAME $PROJECT_VERSION ($PROJECT_DATE NCA)" sandbox "$CARGO_PATH" version @@ -1838,7 +1840,7 @@ else printf "%s\n\n" "See '$PROJECT_NAME $PROJECT_NAME:help' or '$PROJECT_NAME --$PROJECT_NAME:help' for more information about the options and commands that are specific to Carnet." else if ! [[ "${KNOWN_CRATE_STATE-}" ]] || [[ "$KNOWN_CRATE_STATE" != "found" ]]; then - fatal "Could not find a registered crate in '$PWD' or any parent directory" + fatal "Could not find a registered crate in current directory or any parent directory.\n See 'carnet new' and 'carnet init' commands." fi if [[ "$DISABLE_AUTOVERIFICATION" != "yes" ]]; then verify diff --git a/tests/carnet-test.sh b/tests/carnet-test.sh index cc8f6cc..7df63f0 100644 --- a/tests/carnet-test.sh +++ b/tests/carnet-test.sh @@ -103,7 +103,7 @@ else for case in "cases/"*; do case_name="$(basename "$case")" if [[ "${case_name::12}" == "0000-ignored" ]] && [[ "${TEST_IGNORED-}" == "" ]]; then - step "ignored" "$case_name" + step "ignored" "$case_name (Set env TEST_IGNORED to 'yes' to test)" else run_case "$case" fi