5 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
f9c2cc3deb Add migration logic for existing /usr/bin installations
Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com>
2025-11-20 15:08:39 +00:00
copilot-swe-agent[bot]
5923aa4e6e Add symlink for command-line access to openlist-desktop
Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com>
2025-11-18 16:45:24 +00:00
copilot-swe-agent[bot]
9c9b3e713f Change installation path to /opt/OpenList-Desktop
Co-authored-by: elysia-best <39023210+elysia-best@users.noreply.github.com>
2025-11-18 16:43:42 +00:00
copilot-swe-agent[bot]
0ff3fee308 Initial plan 2025-11-18 16:35:11 +00:00
Copilot
0dae544d54 fix(mount): mount button disabled incorrectly on macOS when directory exists (#109) (#110)
Fix macOS mount button disabled issue (#109) - correct mount status logic and add directory creation.
2025-11-13 21:29:26 +08:00
4 changed files with 65 additions and 9 deletions

View File

@@ -1,4 +1,23 @@
#!/bin/bash
chmod +x /usr/bin/install-openlist-service
chmod +x /usr/bin/uninstall-openlist-service
chmod +x /usr/bin/openlist-desktop-service
# Migration: Clean up old installation in /usr/bin if it exists
# This handles upgrades from previous versions that installed to /usr/bin
if [ -f "/usr/bin/openlist-desktop" ] && [ ! -L "/usr/bin/openlist-desktop" ]; then
echo "Migrating from old installation location (/usr/bin) to /opt/OpenList-Desktop"
# Remove old binaries that are now in /opt
rm -f /usr/bin/install-openlist-service
rm -f /usr/bin/uninstall-openlist-service
rm -f /usr/bin/openlist-desktop-service
rm -f /usr/bin/openlist
rm -f /usr/bin/rclone
# Note: /usr/bin/openlist-desktop will be replaced with symlink below
fi
# Set execute permissions for binaries in /opt
chmod +x /opt/OpenList-Desktop/install-openlist-service
chmod +x /opt/OpenList-Desktop/uninstall-openlist-service
chmod +x /opt/OpenList-Desktop/openlist-desktop-service
# Create symlink for easy command-line access
# Using -f flag to force creation even if file exists
ln -sf /opt/OpenList-Desktop/openlist-desktop /usr/bin/openlist-desktop

View File

@@ -1,2 +1,5 @@
#!/bin/bash
/usr/bin/uninstall-openlist-service
/opt/OpenList-Desktop/uninstall-openlist-service
# Remove symlink
rm -f /usr/bin/openlist-desktop

View File

@@ -204,6 +204,23 @@ pub async fn create_rclone_mount_remote_process(
let rclone_conf_path =
get_rclone_config_path().map_err(|e| format!("Failed to get rclone config path: {e}"))?;
// Extract mount point from args and create directory if it doesn't exist.
// The mount point is the second non-flag argument (first is remote:path).
let args_vec = split_args_vec(config.args.clone());
let mount_point_opt = args_vec.iter().filter(|arg| !arg.starts_with('-')).nth(1); // 0th is remote:path, 1st is mount_point
if let Some(mount_point) = mount_point_opt {
let mount_path = Path::new(mount_point);
if !mount_path.exists()
&& let Err(e) = fs::create_dir_all(mount_path)
{
return Err(format!(
"Failed to create mount point directory '{}': {}",
mount_point, e
));
}
}
let api_key = get_api_key();
let port = get_server_port();
let mut args: Vec<String> = vec![
@@ -211,7 +228,7 @@ pub async fn create_rclone_mount_remote_process(
"--config".into(),
rclone_conf_path.to_string_lossy().into_owned(),
];
args.extend(split_args_vec(config.args.clone()));
args.extend(args_vec);
let config = ProcessConfig {
id: config.id.clone(),
@@ -311,9 +328,10 @@ pub async fn get_mount_info_list(
Ok(is_mounted) => {
if process.is_running {
if is_mounted { "mounted" } else { "mounting" }
} else if is_mounted {
"unmounting"
} else {
// If process is not running, the mount point should be considered
// unmounted regardless of whether
// the directory exists or not
"unmounted"
}
}

View File

@@ -11,7 +11,15 @@
"conflicts": ["openlist-desktop"],
"replaces": ["openlist-desktop"],
"postInstallScript": "./packages/linux/post-install.sh",
"preRemoveScript": "./packages/linux/pre-remove.sh"
"preRemoveScript": "./packages/linux/pre-remove.sh",
"files": {
"/opt/OpenList-Desktop/openlist-desktop": "usr/bin/openlist-desktop",
"/opt/OpenList-Desktop/install-openlist-service": "usr/bin/install-openlist-service",
"/opt/OpenList-Desktop/uninstall-openlist-service": "usr/bin/uninstall-openlist-service",
"/opt/OpenList-Desktop/openlist-desktop-service": "usr/bin/openlist-desktop-service",
"/opt/OpenList-Desktop/openlist": "usr/bin/openlist",
"/opt/OpenList-Desktop/rclone": "usr/bin/rclone"
}
},
"rpm": {
"depends": ["openssl"],
@@ -20,7 +28,15 @@
"conflicts": ["openlist-desktop"],
"obsoletes": ["openlist-desktop"],
"postInstallScript": "./packages/linux/post-install.sh",
"preRemoveScript": "./packages/linux/pre-remove.sh"
"preRemoveScript": "./packages/linux/pre-remove.sh",
"files": {
"/opt/OpenList-Desktop/openlist-desktop": "usr/bin/openlist-desktop",
"/opt/OpenList-Desktop/install-openlist-service": "usr/bin/install-openlist-service",
"/opt/OpenList-Desktop/uninstall-openlist-service": "usr/bin/uninstall-openlist-service",
"/opt/OpenList-Desktop/openlist-desktop-service": "usr/bin/openlist-desktop-service",
"/opt/OpenList-Desktop/openlist": "usr/bin/openlist",
"/opt/OpenList-Desktop/rclone": "usr/bin/rclone"
}
}
},
"externalBin": [