{"record":{"id":"45d0de647384666b","repo":"tonhowtf/omniget","slug":"o-arquivo-baixado-nao-contem-o-executavel-do-spicetify","errorCode":null,"errorMessage":"o arquivo baixado nao contem o executavel do spicetify","messagePattern":"o arquivo baixado nao contem o executavel do spicetify","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/spicetify.rs","lineNumber":540,"sourceCode":"    let staging = dir.with_extension(\"new\");\n    let _ = std::fs::remove_dir_all(&staging);\n    std::fs::create_dir_all(&staging)?;\n    let is_zip = asset.name.ends_with(\".zip\");\n    let staging_clone = staging.clone();\n    tokio::task::spawn_blocking(move || {\n        if is_zip {\n            unpack_zip(&data, &staging_clone)\n        } else {\n            unpack_tar_gz(&data, &staging_clone)\n        }\n    })\n    .await\n    .map_err(|e| anyhow!(\"Spawn blocking failed: {}\", e))??;\n\n    let exe = staging.join(bin_name(\"spicetify\"));\n    if !exe.exists() {\n        let _ = std::fs::remove_dir_all(&staging);\n        return Err(anyhow!(\n            \"o arquivo baixado nao contem o executavel do spicetify\"\n        ));\n    }\n    make_executable(&exe);\n\n    let old = dir.with_extension(\"old\");\n    let _ = std::fs::remove_dir_all(&old);\n    if dir.exists() {\n        std::fs::rename(&dir, &old)?;\n    }\n    if let Err(e) = std::fs::rename(&staging, &dir) {\n        if old.exists() {\n            let _ = std::fs::rename(&old, &dir);\n        }\n        return Err(anyhow!(\n            \"nao foi possivel mover a instalacao para o lugar: {}\",\n            e\n        ));","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/spicetify.rs#L522-L558","documentation":"After unpacking the downloaded Spicetify CLI archive into the staging dir, install looks for the platform binary at staging/bin_name(\"spicetify\") and fails when it is absent. The downloaded release asset unpacked successfully but does not contain the expected executable at the expected path.","triggerScenarios":"Calling install when the latest GitHub release asset for the platform has a changed layout (binary nested in a subdirectory or renamed), or a wrong/partial asset was downloaded.","commonSituations":"Upstream Spicetify release restructured its archive; wrong cli_asset_suffix matched an asset for another platform; truncated/corrupted download that still unzipped partially.","solutions":["Check the archive layout of the current spicetify-cli release and update the expected binary path","Re-run install to re-download a fresh, complete asset","Verify the asset suffix from cli_asset_suffix() matches the intended platform","Make install search staging recursively for the binary instead of only the top level"],"exampleFix":"// before\nlet exe = staging.join(bin_name(\"spicetify\"));\n// after\nlet exe = find_file_recursive(&staging, &bin_name(\"spicetify\")).ok_or_else(|| anyhow!(\"o arquivo baixado nao contem o executavel do spicetify\"))?;","handlingStrategy":"validation","validationCode":"// after download, before trusting the asset:\nlet ok = matches!(asset.name, n if n.ends_with(expected_suffix)) && data.len() > MIN_CLI_SIZE;","typeGuard":null,"tryCatchPattern":"if let Err(e) = install().await {\n    if e.to_string().contains(\"executavel do spicetify\") {\n        prompt_user_to_report_release_layout_change();\n    }\n}","preventionTips":["Pin or verify the upstream release layout in a test that unpacks the real asset","Search the staging dir recursively for the binary instead of assuming a fixed path","Surface the asset name/tag in the error message to ease diagnosis"],"tags":["install","github-release","filesystem"],"backgroundTag":"file-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}