rds_ssm_connect 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rds_ssm_connect",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "rds-ssm-connect"
3
- version = "1.7.0"
3
+ version = "1.7.1"
4
4
  description = "Secure RDS connections through AWS SSM"
5
5
  authors = ["Iaroslav Pyrogov"]
6
6
  edition = "2024"
@@ -710,18 +710,56 @@ pub struct PrerequisitesResult {
710
710
  async fn check_prerequisites() -> Result<PrerequisitesResult, String> {
711
711
  use std::process::Command;
712
712
 
713
+ // Common paths where tools might be installed
714
+ let search_paths = [
715
+ "/usr/local/bin",
716
+ "/opt/homebrew/bin",
717
+ "/usr/bin",
718
+ "/bin",
719
+ &format!("{}/.local/bin", std::env::var("HOME").unwrap_or_default()),
720
+ ];
721
+
722
+ fn find_command(name: &str, search_paths: &[&str]) -> Option<std::path::PathBuf> {
723
+ // First try PATH
724
+ if let Ok(output) = std::process::Command::new("which").arg(name).output() {
725
+ if output.status.success() {
726
+ let path = String::from_utf8_lossy(&output.stdout).trim().to_string();
727
+ if !path.is_empty() {
728
+ return Some(std::path::PathBuf::from(path));
729
+ }
730
+ }
731
+ }
732
+ // Then search common paths
733
+ for dir in search_paths {
734
+ let path = std::path::Path::new(dir).join(name);
735
+ if path.exists() {
736
+ return Some(path);
737
+ }
738
+ }
739
+ None
740
+ }
741
+
713
742
  let mut prerequisites = Vec::new();
714
743
 
715
744
  // Check aws-vault
716
- let aws_vault = match Command::new("aws-vault").arg("--version").output() {
717
- Ok(output) if output.status.success() => PrerequisiteStatus {
718
- name: "aws-vault".to_string(),
719
- installed: true,
720
- version: Some(String::from_utf8_lossy(&output.stdout).trim().to_string()),
721
- install_url: "https://github.com/99designs/aws-vault#installing".to_string(),
722
- install_command: Some("brew install aws-vault".to_string()),
745
+ let aws_vault = match find_command("aws-vault", &search_paths) {
746
+ Some(path) => match Command::new(&path).arg("--version").output() {
747
+ Ok(output) if output.status.success() => PrerequisiteStatus {
748
+ name: "aws-vault".to_string(),
749
+ installed: true,
750
+ version: Some(String::from_utf8_lossy(&output.stdout).trim().to_string()),
751
+ install_url: "https://github.com/99designs/aws-vault#installing".to_string(),
752
+ install_command: Some("brew install aws-vault".to_string()),
753
+ },
754
+ _ => PrerequisiteStatus {
755
+ name: "aws-vault".to_string(),
756
+ installed: false,
757
+ version: None,
758
+ install_url: "https://github.com/99designs/aws-vault#installing".to_string(),
759
+ install_command: Some("brew install aws-vault".to_string()),
760
+ },
723
761
  },
724
- _ => PrerequisiteStatus {
762
+ None => PrerequisiteStatus {
725
763
  name: "aws-vault".to_string(),
726
764
  installed: false,
727
765
  version: None,
@@ -732,18 +770,27 @@ async fn check_prerequisites() -> Result<PrerequisitesResult, String> {
732
770
  prerequisites.push(aws_vault);
733
771
 
734
772
  // Check AWS CLI
735
- let aws_cli = match Command::new("aws").arg("--version").output() {
736
- Ok(output) if output.status.success() => {
737
- let version_str = String::from_utf8_lossy(&output.stdout);
738
- PrerequisiteStatus {
773
+ let aws_cli = match find_command("aws", &search_paths) {
774
+ Some(path) => match Command::new(&path).arg("--version").output() {
775
+ Ok(output) if output.status.success() => {
776
+ let version_str = String::from_utf8_lossy(&output.stdout);
777
+ PrerequisiteStatus {
778
+ name: "AWS CLI".to_string(),
779
+ installed: true,
780
+ version: Some(version_str.split_whitespace().take(1).collect()),
781
+ install_url: "https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html".to_string(),
782
+ install_command: Some("brew install awscli".to_string()),
783
+ }
784
+ }
785
+ _ => PrerequisiteStatus {
739
786
  name: "AWS CLI".to_string(),
740
- installed: true,
741
- version: Some(version_str.split_whitespace().take(1).collect()),
787
+ installed: false,
788
+ version: None,
742
789
  install_url: "https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html".to_string(),
743
790
  install_command: Some("brew install awscli".to_string()),
744
- }
745
- }
746
- _ => PrerequisiteStatus {
791
+ },
792
+ },
793
+ None => PrerequisiteStatus {
747
794
  name: "AWS CLI".to_string(),
748
795
  installed: false,
749
796
  version: None,
@@ -754,15 +801,24 @@ async fn check_prerequisites() -> Result<PrerequisitesResult, String> {
754
801
  prerequisites.push(aws_cli);
755
802
 
756
803
  // Check Session Manager Plugin
757
- let ssm_plugin = match Command::new("session-manager-plugin").arg("--version").output() {
758
- Ok(output) if output.status.success() => PrerequisiteStatus {
759
- name: "Session Manager Plugin".to_string(),
760
- installed: true,
761
- version: Some(String::from_utf8_lossy(&output.stdout).trim().to_string()),
762
- install_url: "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html".to_string(),
763
- install_command: None,
804
+ let ssm_plugin = match find_command("session-manager-plugin", &search_paths) {
805
+ Some(path) => match Command::new(&path).arg("--version").output() {
806
+ Ok(output) if output.status.success() => PrerequisiteStatus {
807
+ name: "Session Manager Plugin".to_string(),
808
+ installed: true,
809
+ version: Some(String::from_utf8_lossy(&output.stdout).trim().to_string()),
810
+ install_url: "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html".to_string(),
811
+ install_command: None,
812
+ },
813
+ _ => PrerequisiteStatus {
814
+ name: "Session Manager Plugin".to_string(),
815
+ installed: false,
816
+ version: None,
817
+ install_url: "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html".to_string(),
818
+ install_command: None,
819
+ },
764
820
  },
765
- _ => PrerequisiteStatus {
821
+ None => PrerequisiteStatus {
766
822
  name: "Session Manager Plugin".to_string(),
767
823
  installed: false,
768
824
  version: None,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://schema.tauri.app/config/2",
3
3
  "productName": "RDS SSM Connect",
4
- "version": "1.7.0",
4
+ "version": "1.7.1",
5
5
  "identifier": "com.rds-ssm-connect.desktop",
6
6
  "build": {
7
7
  "beforeDevCommand": "npm run dev:vite",