From fcfa7843fcf6c9e523f4cd8dd8a141c5988ead4d Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:02:23 -0300 Subject: [PATCH 1/8] wip --- Cargo.lock | 55 ------------------------------------------------ Cargo.toml | 9 ++++---- README.md | 7 +++++- scripts/action | 2 +- src/cmds/repo.rs | 11 ++-------- src/git.rs | 44 ++++++++++++++++++++++++++++++++++++++ src/main.rs | 1 + 7 files changed, 58 insertions(+), 71 deletions(-) create mode 100644 src/git.rs diff --git a/Cargo.lock b/Cargo.lock index fdef368..6f44884 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,19 +134,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "getrandom" version = "0.1.14" @@ -222,25 +209,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", - "libssh2-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "libssh2-sys" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", - "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "libz-sys" version = "1.0.25" @@ -277,7 +250,6 @@ dependencies = [ "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.28 (registry+https://github.com/rust-lang/crates.io-index)", "raw_tty 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -291,32 +263,11 @@ name = "numtoa" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "openssl" -version = "0.10.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "openssl-probe" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "openssl-src" -version = "111.6.1+1.1.1d" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "openssl-sys" version = "0.9.54" @@ -325,7 +276,6 @@ dependencies = [ "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-src 111.6.1+1.1.1d (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -708,8 +658,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum derive_more 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6d944ac6003ed268757ef1ee686753b57efc5fcf0ebe7b64c9fc81e7e32ff839" "checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" -"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c1af51ea8a906616af45a4ce78eacf25860f7a13ae7bf8a814693f0f4037a26" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" @@ -719,15 +667,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" "checksum libgit2-sys 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4870c781f6063efb83150cd22c1ddf6ecf58531419e7570cdcced46970f64a16" -"checksum libssh2-sys 0.2.16 (registry+https://github.com/rust-lang/crates.io-index)" = "7bb70f29dc7c31d32c97577f13f41221af981b31248083e347b7f2c39225a6bc" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" -"checksum openssl 0.10.28 (registry+https://github.com/rust-lang/crates.io-index)" = "973293749822d7dd6370d6da1e523b0d1db19f06c459134c658b2a4261378b52" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-src 111.6.1+1.1.1d (registry+https://github.com/rust-lang/crates.io-index)" = "c91b04cb43c1a8a90e934e0cd612e2a5715d976d2d6cff4490278a0cddf35005" "checksum openssl-sys 0.9.54 (registry+https://github.com/rust-lang/crates.io-index)" = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" diff --git a/Cargo.toml b/Cargo.toml index 9e68323..f2d6af4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,13 +19,12 @@ raw_tty = "0.1.0" lazy_static = "1.4.0" dirs = "2.0.0" terminal_size = "0.1.10" -git2 = "0.10.0" walkdir = "2" -openssl = { version = '0.10', optional = true } -[features] -default = [] -vendored-openssl = ["openssl/vendored"] +[dependencies.git2] +version = "0.10.0" +default-features = false +features = ["https"] [[bin]] bench = false diff --git a/README.md b/README.md index 4e40730..66b0be2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,12 @@ An interactive cheatsheet tool for the command-line. ![Demo](https://user-images.githubusercontent.com/3226564/76437136-ddc35900-6397-11ea-823c-d2da7615fe60.gif) -**navi** allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands. Argument suggestions are prompted to you. +**navi** allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands. Argument suggestions are prompted to you. + +It will: +- make you type less; +- spare you from knowing CLIs by heart; +- teach you new one-liners. It uses [fzf](https://github.com/junegunn/fzf) under the hood and it can be either used as a command or as a shell widget (*à la* Ctrl-R). diff --git a/scripts/action b/scripts/action index fbd8612..ac1eba8 100755 --- a/scripts/action +++ b/scripts/action @@ -22,7 +22,7 @@ release() { if [ -n "$target" ]; then cargo install cross 2> /dev/null || true - cross build --release --locked --target "$target" --features vendored-openssl + cross build --release --locked --target "$target" bin_folder="${target}/release" else cargo build --release --locked diff --git a/src/cmds/repo.rs b/src/cmds/repo.rs index a118fce..3bc4324 100644 --- a/src/cmds/repo.rs +++ b/src/cmds/repo.rs @@ -1,6 +1,7 @@ use crate::cheat::SuggestionType; use crate::filesystem; use crate::fzf; +use crate::git; use git2::Repository; use std::error::Error; use std::fs; @@ -8,15 +9,7 @@ use std::io::Write; use walkdir::WalkDir; pub fn add(uri: String) -> Result<(), Box> { - let actual_uri = if uri.contains("://") || uri.contains('@') { - uri - } else { - format!("https://github.com/{}", uri) - }; - - let parts: Vec<&str> = actual_uri.split('/').collect(); - let user = parts[parts.len() - 2]; - let repo = parts[parts.len() - 1].replace(".git", ""); + let (actual_uri, user, repo) = git::meta(uri.as_str()); let cheat_path_str = filesystem::pathbuf_to_string(filesystem::cheat_pathbuf().unwrap()); let tmp_path_str = format!("{}/tmp", cheat_path_str); diff --git a/src/git.rs b/src/git.rs new file mode 100644 index 0000000..400668f --- /dev/null +++ b/src/git.rs @@ -0,0 +1,44 @@ +pub fn meta(uri: &str) -> (String, String, String) { + let actual_uri = if uri.contains("://") { + uri.to_string() + } else if uri.contains('@') { + uri.replace("git@", "https://").replace(':', "/") + } else { + format!("https://github.com/{}", uri) + }; + + let parts: Vec<&str> = actual_uri.split('/').collect(); + let user = parts[parts.len() - 2]; + let repo = parts[parts.len() - 1].replace(".git", ""); + + (actual_uri.clone(), user.to_string(), repo) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_meta_github_https() { + let (actual_uri, user, repo) = meta("https://github.com/denisidoro/navi"); + assert_eq!(actual_uri, "https://github.com/denisidoro/navi".to_string()); + assert_eq!(user, "denisidoro".to_string()); + assert_eq!(repo, "navi".to_string()); + } + + #[test] + fn test_meta_github_ssh() { + let (actual_uri, user, repo) = meta("git@github.com:denisidoro/navi.git"); + assert_eq!(actual_uri, "https://github.com/denisidoro/navi".to_string()); + assert_eq!(user, "denisidoro".to_string()); + assert_eq!(repo.contains("navi"), true); + } + + #[test] + fn test_meta_gitlab_https() { + let (actual_uri, user, repo) = meta("https://gitlab.com/user/repo.git"); + assert_eq!(actual_uri, "https://gitlab.com/user/repo.git".to_string()); + assert_eq!(user, "user".to_string()); + assert_eq!(repo.contains("repo"), true); + } +} diff --git a/src/main.rs b/src/main.rs index e4c645b..a7048d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ mod handler; mod option; mod terminal; mod welcome; +mod git; use std::error::Error; From ebcdb8d16208d22a3da9001dbb316061c543a7cc Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:02:52 -0300 Subject: [PATCH 2/8] linting --- src/git.rs | 2 +- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git.rs b/src/git.rs index 400668f..efd7114 100644 --- a/src/git.rs +++ b/src/git.rs @@ -1,7 +1,7 @@ pub fn meta(uri: &str) -> (String, String, String) { let actual_uri = if uri.contains("://") { uri.to_string() - } else if uri.contains('@') { + } else if uri.contains('@') { uri.replace("git@", "https://").replace(':', "/") } else { format!("https://github.com/{}", uri) diff --git a/src/main.rs b/src/main.rs index a7048d1..0aad076 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,11 +6,11 @@ mod cmds; mod display; mod filesystem; mod fzf; +mod git; mod handler; mod option; mod terminal; mod welcome; -mod git; use std::error::Error; From 503c6b54a37bf26be97c4917156dd54d37ed931a Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:03:05 -0300 Subject: [PATCH 3/8] bump --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f44884..9a0cd98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,7 +245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "navi" -version = "2.1.1" +version = "2.1.2" dependencies = [ "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "git2 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index f2d6af4..015e386 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "navi" -version = "2.1.1" +version = "2.1.2" authors = ["Denis Isidoro "] edition = "2018" description = "An interactive cheatsheet tool for the command-line" From dd6c54f089933a627f7fd2758aeec641cd384e1e Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:13:55 -0300 Subject: [PATCH 4/8] wip --- scripts/install | 12 ++++++++++++ src/git.rs | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 5fd90f1..e6930f2 100755 --- a/scripts/install +++ b/scripts/install @@ -113,6 +113,18 @@ get_shell() { echo $SHELL | xargs basename } +installation_finish_instructions() { + local -r shell="$(get_shell)" + echoerr -e "Finished. To call navi, restart your shell or reload the config file:\n source ~/.${shell}rc" + local code + if [[ $shell = "zsh" ]]; then + code="navi widget ${shell} | source" + else + code="source <(navi widget ${shell})" + fi + echoerr -e "\nTo add the Ctrl-G keybinding, add the following to ~/.${shell}rc:\n ${code}" +} + install_navi() { export SOURCE_DIR="${SOURCE_DIR:-"$(get_source_dir)"}" export BIN_DIR="${BIN_DIR:-"$(get_bin_dir)"}" diff --git a/src/git.rs b/src/git.rs index efd7114..72100dc 100644 --- a/src/git.rs +++ b/src/git.rs @@ -2,7 +2,7 @@ pub fn meta(uri: &str) -> (String, String, String) { let actual_uri = if uri.contains("://") { uri.to_string() } else if uri.contains('@') { - uri.replace("git@", "https://").replace(':', "/") + uri.replace(':', "/").replace("git@", "https://") } else { format!("https://github.com/{}", uri) }; @@ -29,9 +29,9 @@ mod tests { #[test] fn test_meta_github_ssh() { let (actual_uri, user, repo) = meta("git@github.com:denisidoro/navi.git"); - assert_eq!(actual_uri, "https://github.com/denisidoro/navi".to_string()); + assert_eq!(actual_uri, "https://github.com/denisidoro/navi.git".to_string()); assert_eq!(user, "denisidoro".to_string()); - assert_eq!(repo.contains("navi"), true); + assert_eq!(repo, "navi".to_string()); } #[test] @@ -39,6 +39,6 @@ mod tests { let (actual_uri, user, repo) = meta("https://gitlab.com/user/repo.git"); assert_eq!(actual_uri, "https://gitlab.com/user/repo.git".to_string()); assert_eq!(user, "user".to_string()); - assert_eq!(repo.contains("repo"), true); + assert_eq!(repo, "repo".to_string()); } } From 7eccec0a51bec19c46aa63a8532024337a162680 Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:14:02 -0300 Subject: [PATCH 5/8] linting --- scripts/install | 4 ++-- src/git.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index e6930f2..9a677d8 100755 --- a/scripts/install +++ b/scripts/install @@ -119,9 +119,9 @@ installation_finish_instructions() { local code if [[ $shell = "zsh" ]]; then code="navi widget ${shell} | source" - else + else code="source <(navi widget ${shell})" - fi + fi echoerr -e "\nTo add the Ctrl-G keybinding, add the following to ~/.${shell}rc:\n ${code}" } diff --git a/src/git.rs b/src/git.rs index 72100dc..5d9df30 100644 --- a/src/git.rs +++ b/src/git.rs @@ -29,7 +29,10 @@ mod tests { #[test] fn test_meta_github_ssh() { let (actual_uri, user, repo) = meta("git@github.com:denisidoro/navi.git"); - assert_eq!(actual_uri, "https://github.com/denisidoro/navi.git".to_string()); + assert_eq!( + actual_uri, + "https://github.com/denisidoro/navi.git".to_string() + ); assert_eq!(user, "denisidoro".to_string()); assert_eq!(repo, "navi".to_string()); } From be4ea8424fe21ee518ef1e49185ca0d1d6c3f889 Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:21:28 -0300 Subject: [PATCH 6/8] Add version to assets (#276) --- .github/workflows/cd.yml | 4 ++-- scripts/install | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 7ee639f..3157fdc 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -38,5 +38,5 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: target/tar/navi.tar.gz - asset_name: navi-${{ matrix.target }}.tar.gz - tag: ${{ github.ref }} \ No newline at end of file + tag: ${{ github.ref }} + asset_name: navi-${{ github.ref }}-${{ matrix.target }}.tar.gz \ No newline at end of file diff --git a/scripts/install b/scripts/install index 9a677d8..63217a3 100755 --- a/scripts/install +++ b/scripts/install @@ -64,7 +64,7 @@ asset_url() { local -r variant="${2:-}" if [[ -n "$variant" ]]; then - echo "https://github.com/denisidoro/navi/releases/download/v${version}/navi-${variant}.tar.gz" + echo "https://github.com/denisidoro/navi/releases/download/v${version}/navi-v${version}-${variant}.tar.gz" else echo "https://github.com/denisidoro/navi/archive/v${version}.tar.gz" fi From 081f3216f35ac5b3a25c21de8d249e8a4a1aaa5b Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:23:33 -0300 Subject: [PATCH 7/8] Remove duplicates --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 196d463..05b7b34 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,10 @@ An interactive cheatsheet tool for the command-line. **navi** allows you to browse through cheatsheets (that you may write yourself or download from maintainers) and execute commands. Argument suggestions are prompted to you. -It will: -- make you type less; -- spare you from knowing CLIs by heart; -- teach you new one-liners. - -It will: -- make you type less; -- spare you from knowing CLIs by heart; -- teach you new one-liners. +#### Pros +- it will make you type less; +- it will spare you from knowing CLIs by heart; +- it will teach you new one-liners. It uses [fzf](https://github.com/junegunn/fzf) under the hood and it can be either used as a command or as a shell widget (*à la* Ctrl-R). From 2688a7263390c25dd834b72f9cec44cbf02cbc14 Mon Sep 17 00:00:00 2001 From: Denis Isidoro Date: Mon, 16 Mar 2020 08:27:58 -0300 Subject: [PATCH 8/8] Fix typos --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 63217a3..b560167 100755 --- a/scripts/install +++ b/scripts/install @@ -97,8 +97,8 @@ get_target() { local target case "$archi" in Darwin*) target="x86_64-osx" ;; - Linux\ *x86*) is_android && target="aarch64-linux-android" || target="x86_64-unknown-linux-musl" ;; - *arm*) is_android && target="armv7-linux-androideabi" || target="armv7-unknown-linux-musleabihf" ;; + Linux\ *x86*) $is_android && target="aarch64-linux-android" || target="x86_64-unknown-linux-musl" ;; + *arm*) $is_android && target="armv7-linux-androideabi" || target="armv7-unknown-linux-musleabihf" ;; *) target="" ;; esac