Skip to content

Commit

Permalink
fix(bundler): create tauri tools dir first. make tools executable. (t…
Browse files Browse the repository at this point in the history
…auri-apps#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
  • Loading branch information
FabianLars authored Dec 2, 2024
1 parent 8ba5e16 commit a692c89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions crates/tauri-bundler/src/bundle/linux/appimage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
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");
Expand Down Expand Up @@ -257,9 +259,8 @@ fn prepare_tools(tools_path: &Path, arch: &str) -> crate::Result<PathBuf> {
fn write_and_make_executable(path: &Path, data: Vec<u8>) -> 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(())
}
2 changes: 1 addition & 1 deletion packages/cli/__tests__/template.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
Expand Down

0 comments on commit a692c89

Please sign in to comment.