Skip to content

Commit

Permalink
0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ahqsoftwares committed Sep 5, 2024
1 parent 92e36a0 commit bf377d5
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 300 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "ahqstore_cli_rs"
version = "0.5.5"
version = "0.6.0"
description = "AHQ Store CLI"
repository = "https://github.com/ahqstore/cli"
homepage = "https://github.com/ahqstore/cli"
Expand Down Expand Up @@ -32,7 +32,7 @@ chalk_rs = "1"
lazy_static = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
ahqstore-types = "3.1.7"
ahqstore-types = { version = "3", features = ["apps_repo"] }
reqwest = { version = "0.12", features = ["json", "blocking"] }
sha2 = "0.10"
image = { version = "0.25", default-features = false, features = [
Expand All @@ -42,7 +42,7 @@ image = { version = "0.25", default-features = false, features = [
rand = "0.8"

[target.'cfg(unix)'.dependencies]
openssl-sys = { version = "0.9.103", features = ["vendored"] }
openssl-sys = { version = "0.9", features = ["vendored"] }

[build-dependencies]
napi-build = { version = "2", optional = true }
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Read more about it [here](https://ahqstore.github.io)

# Changelog

## 0.6.0 **(m)** 05-Sep-2024 10:37PM IST

- Introduced ahqstore-types apps validation
- Now you can view schemas in [docs.rs](https://docs.rs/ahqstore_cli_rs)
- Update Dependencies

## 0.5.5 03-Sep-2024 10:20PM IST

- update ahqstore-types
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ahqstore/cli",
"version": "0.5.5",
"version": "0.6.0",
"readme": "./README.md",
"napi": {
"name": "cli",
Expand Down
3 changes: 2 additions & 1 deletion src/app/build/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ macro_rules! windowsPlatform {
($num: ident, $win: ident, $config: ident, $gh_r: ident, $final_config: ident, $platform: ident, $options: ident, $finder: ident) => {
$num += 1;
if let Some(platform) = $config.platform.$platform {
if !matches!(&platform, &InstallerFormat::LinuxAppImage | &InstallerFormat::AndroidApkZip) {
if matches!(&platform, &InstallerFormat::LinuxAppImage | &InstallerFormat::AndroidApkZip) {
ERR.println(&"Invalid File Format, expected a valid windows format");
process::exit(1);
}

let Some(options) = $config.platform.$options else {
Expand Down
43 changes: 15 additions & 28 deletions src/app/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ahqstore_types::{
use lazy_static::lazy_static;
use reqwest::blocking::{Client, ClientBuilder};
use serde::{Deserialize, Serialize};
use serde_json::{from_str, to_string, to_string_pretty};
use serde_json::{from_str, to_string};
use std::{collections::HashMap, env, fs, process};

use crate::app::ERR;
Expand Down Expand Up @@ -170,33 +170,20 @@ pub fn build_config(upload: bool, gh_action: bool) {
});
}

// if let Some(platform) = config.platform.linuxArm64Platform {
// let Some(finder) = config.finder.linuxFinder else {
// ERR.println(&"Linux Finder Config not found!");
// process::exit(1);
// };

// let assets = find_assets(&gh_r, &finder);

// if assets.len() > 1 {
// ERR.println(&"Multiple assets found");
// process::exit(1);
// }

// final_config.downloadUrls.insert(
// 2,
// DownloadUrl {
// installerType: platform,
// url: assets[0].browser_download_url.clone(),
// },
// );

// final_config.install.linux = Some(InstallerOptionsLinux {
// assetId: 2
// });
// }

let config_file = to_string_pretty(&final_config).unwrap();
INFO.println(&"Validating config");
match final_config.validate() {
Ok(x) => {
println!("{x}");
},
Err(x) => {
ERR.println(&"An error occured!");
println!("{x}");

panic!("👆🏼 Please fix the above issues!");
}
}

let config_file = to_string(&final_config).unwrap();

if !gh_action {
println!("{} {}.json", &*INFO, &app_id);
Expand Down
30 changes: 1 addition & 29 deletions src/app/create/inquire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,35 +75,7 @@ pub fn inquire<'a>() -> (String, Config<'a>) {
};

INFO.println(&"Validating author id & repo");

// let val: Option<()> = (|| {
// let data: ServerUserResp = CLIENT
// .get(format!(
// "https://ahqstore-server.onrender.com/users/{}",
// &user_id
// ))
// .send()
// .ok()?
// .json()
// .ok()?;

// if data.linked_acc.contains(&owner.into()) {
// return Some(());
// }
// None
// })();

// if let None = val {
// ERR.println(
// &r#"Could not validate author id with github username. It may be because:
// - The account id provided is not valid
// - The account id has developer mode disabled
// - The GitHub repo owner doesn't seem to be in the list of linked_accounts
// - The GitHub repo is invalid"#,
// );
// process::exit(1);
// }


(
app_id.clone(),
IMetadata::new(
Expand Down
8 changes: 1 addition & 7 deletions src/app/create/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ pub fn create(force: bool) {
fs::write(format!("{}/icon.png", &base_img), icon).ok()?;

let readme = include_str!("./readme.md");
fs::write("./.ahqstore/README.md", readme).ok()?;

let readme = include_str!("./readme.es.md");
fs::write("./.ahqstore/README.es.md", readme).ok()?;

let readme = include_str!("./readme.hi.md");
fs::write("./.ahqstore/README.hi.md", readme).ok()
fs::write("./.ahqstore/README.md", readme).ok()
})()
.is_some();

Expand Down
80 changes: 0 additions & 80 deletions src/app/create/readme.es.md

This file was deleted.

80 changes: 0 additions & 80 deletions src/app/create/readme.hi.md

This file was deleted.

Loading

0 comments on commit bf377d5

Please # to comment.