From a692c8937f40e931bb5104c3efecbbb9e8ef1b19 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Tue, 3 Dec 2024 00:29:42 +0100 Subject: [PATCH] fix(bundler): create tauri tools dir first. make tools executable. (#11852) * not sure what's going on yet * . * fix(bundler): try to create tauri tools dir * Discard changes to .github/workflows/test-cli-js.yml * fix --- crates/tauri-bundler/src/bundle/linux/appimage.rs | 9 +++++---- packages/cli/__tests__/template.spec.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/tauri-bundler/src/bundle/linux/appimage.rs b/crates/tauri-bundler/src/bundle/linux/appimage.rs index fd2d1e58297d..02fe710d394a 100644 --- a/crates/tauri-bundler/src/bundle/linux/appimage.rs +++ b/crates/tauri-bundler/src/bundle/linux/appimage.rs @@ -47,6 +47,8 @@ pub fn bundle_project(settings: &Settings) -> crate::Result> { dirs::cache_dir().map_or_else(|| output_path.to_path_buf(), |p| p.join("tauri")) }); + fs::create_dir_all(&tools_path)?; + let linuxdeploy_path = prepare_tools(&tools_path, tools_arch)?; let package_dir = settings.project_out_directory().join("bundle/appimage_deb"); @@ -257,9 +259,8 @@ fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result { fn write_and_make_executable(path: &Path, data: Vec) -> std::io::Result<()> { use std::os::unix::fs::PermissionsExt; - let mut file = fs::File::create(path)?; - file.write_all(&data)?; - let mut perms = file.metadata()?.permissions(); - perms.set_mode(0o770); + fs::write(path, &data)?; + fs::set_permissions(path, fs::Permissions::from_mode(0o770))?; + Ok(()) } diff --git a/packages/cli/__tests__/template.spec.ts b/packages/cli/__tests__/template.spec.ts index 9e0a05493eb0..1509ad550a55 100644 --- a/packages/cli/__tests__/template.spec.ts +++ b/packages/cli/__tests__/template.spec.ts @@ -71,7 +71,7 @@ describe('[CLI] @tauri-apps/cli template', () => { const config = readFileSync(configPath).toString() writeFileSync(configPath, config.replace('com.tauri.dev', 'com.tauri.test')) - await cli.run(['build']) + await cli.run(['build', '-vvv']) process.chdir(cwd) }) })