Skip to content

Commit

Permalink
fix: update command shoult not be interrupted
Browse files Browse the repository at this point in the history
  • Loading branch information
innobead committed Dec 12, 2022
1 parent c4a9d26 commit 9b81911
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
18 changes: 9 additions & 9 deletions crates/app/src/service/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use compress_tools::{uncompress_archive, Ownership};
use fs_extra::move_items;
use is_executable::IsExecutable;
use libcli_rs::progress::{ProgressBar, ProgressTrait};
use log::{debug, error, info};
use log::{debug, error, info, warn};
use regex::{Captures, Regex};
use simpledi_rs::di::{DIContainer, DIContainerExtTrait, DependencyInjectTrait};
use symlink::{remove_symlink_dir, remove_symlink_file, symlink_dir, symlink_file};
Expand Down Expand Up @@ -486,10 +486,11 @@ impl ReleaseAsyncTrait for ReleaseService {
for asset in package_github.assets.iter() {
let asset_download_url = decode(&asset.browser_download_url)?;

if !asset_names.contains(&asset.name) // assets not mentioned in assert names, just ignored
// assets not mentioned in assert names, just ignored
if !asset_names.contains(&asset.name)
&& !asset_names
.iter()
.any(|it| asset_download_url.ends_with(it))
.iter()
.any(|it| asset_download_url.ends_with(it))
{
debug!(
"Ignored {}, not mentioned or not right arch type defined in the package artifact config",
Expand All @@ -502,12 +503,11 @@ impl ReleaseAsyncTrait for ReleaseService {
}

if asset_download_urls.is_empty() {
return Err(anyhow!(
"No available artifacts for {} to download, \
so probably the download path in package artifact config outdated. \
Please report issue to https://github.com/innobead/huber",
warn!(
"No available artifacts for {} to download, so probably the download path in package \
artifact config outdated. Please report issue to https://github.com/innobead/huber",
package.name
));
);
}

// download
Expand Down
13 changes: 8 additions & 5 deletions crates/generator/src/pkg/tealdeer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ pub fn release() -> Package {
detail: None,
targets: vec![
PackageTargetType::LinuxAmd64(PackageManagement {
artifact_templates: vec!["{version}/tldr-linux-x86_64-musl".to_string()],
artifact_templates: vec![
"{version}/tealdeer-linux-x86_64-musl".to_string(),
"{version}/tldr-linux-x86_64-musl".to_string(),
],
executable_templates: None,
executable_mappings: None,
install_commands: None,
Expand All @@ -20,8 +23,8 @@ pub fn release() -> Package {
tag_version_regex_template: None,
scan_dirs: None,
}),
PackageTargetType::LinuxArm64(PackageManagement {
artifact_templates: vec!["{version}/tldr-linux-arm-musleabihf".to_string()],
PackageTargetType::MacOS(PackageManagement {
artifact_templates: vec!["{version}/tealdeer-macos-x86_64".to_string()],
executable_templates: None,
executable_mappings: None,
install_commands: None,
Expand All @@ -30,8 +33,8 @@ pub fn release() -> Package {
tag_version_regex_template: None,
scan_dirs: None,
}),
PackageTargetType::LinuxArm32(PackageManagement {
artifact_templates: vec!["{version}/tldr-linux-armv7-musleabihf".to_string()],
PackageTargetType::Windows(PackageManagement {
artifact_templates: vec!["{version}/tealdeer-windows-x86_64-msvc.exe".to_string()],
executable_templates: None,
executable_mappings: None,
install_commands: None,
Expand Down
9 changes: 5 additions & 4 deletions generated/packages/tealdeer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ source:
targets:
- LinuxAmd64:
artifact_templates:
- "{version}/tealdeer-linux-x86_64-musl"
- "{version}/tldr-linux-x86_64-musl"
- LinuxArm64:
- MacOS:
artifact_templates:
- "{version}/tldr-linux-arm-musleabihf"
- LinuxArm32:
- "{version}/tealdeer-macos-x86_64"
- Windows:
artifact_templates:
- "{version}/tldr-linux-armv7-musleabihf"
- "{version}/tealdeer-windows-x86_64-msvc.exe"
detail: ~

0 comments on commit 9b81911

Please sign in to comment.