B2: setup finish without hang, Open with for PHP files, 0.1.0-alpha
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run

- Finish page starts Lutra through Explorer (Exec, returns at once)
  instead of RunAsUser/ShellExecute on the setup's UI thread. The 0.0.0
  setup hung there while the new, unsigned exe was checked (Norton 360
  active); Windows ended it and left lutra-desktop.exe suspended.
  The NSIS template is an adapted copy of tauri-bundler 2.10.2's.
- installer/hooks.nsh registers Lutra only under OpenWithProgids and
  Applications\lutra-desktop.exe for .php/.phtml/.phpt/.inc; the
  default app stays. The uninstaller removes exactly those entries.
  macOS gets an Alternate-rank CFBundleDocumentTypes entry and handles
  RunEvent::Opened.
- A file path argument opens the file inside its Git/Composer root (or
  folder); a running instance takes it over, switching projects only
  when the file lies outside (never over unsaved changes).
- Version 0.1.0-alpha in the workspace, tauri.conf.json and ui; a test
  keeps tauri.conf.json in step with the crate version.
- xtask bundle passes CARGO_TARGET_DIR to the Tauri CLI as an absolute
  path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-31 22:37:56 +01:00
parent 84ff80a89f
commit b17d26b400
17 changed files with 1430 additions and 58 deletions

View file

@ -10,7 +10,7 @@ pub struct Args {
pub control: Option<u16>,
/// Isolated data directory (`--data-dir PATH`), see [`crate::datadir`].
pub data_dir: Option<PathBuf>,
/// Folder or file to open.
/// Folder or file to open (see [`crate::open`]).
pub path: Option<PathBuf>,
/// `--help` was given.
pub help: bool,
@ -21,6 +21,9 @@ pub struct Args {
/// Usage text for `--help`.
pub const USAGE: &str = "usage: lutra-desktop [--control PORT] [--data-dir DIR] [PATH]
PATH a folder to open as the project, or a file to open in the
project around it (its Git or Composer root, else its
folder); a running Lutra takes it over
--control PORT serve the JSON control channel on 127.0.0.1:PORT; without
--data-dir or LUTRA_DATA_DIR the data lives in
<temp>/lutra-control/PORT
@ -143,6 +146,20 @@ mod tests {
assert!(p(&["a", "b"]).is_err());
}
#[test]
fn takes_a_bare_file_path_from_open_with() {
let a = p(&[r"C:\Users\me\My Projects\shop\src\Kernel.php"]).unwrap();
assert_eq!(
a.path,
Some(PathBuf::from(
r"C:\Users\me\My Projects\shop\src\Kernel.php"
))
);
assert_eq!(a.control, None);
let b = parse_os([OsString::from("/home/me/app/index.php")]).unwrap();
assert_eq!(b.path, Some(PathBuf::from("/home/me/app/index.php")));
}
#[test]
fn reads_raw_arguments() {
let a = parse_os([OsString::from("--control"), OsString::from("7937")]).unwrap();