@ahqstore/cli 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  edition = "2021"
3
3
  name = "ahqstore_cli_rs"
4
- version = "0.3.4"
4
+ version = "0.3.5"
5
5
  description = "AHQ Store CLI"
6
6
  repository = "https://github.com/ahqstore/cli"
7
7
  homepage = "https://github.com/ahqstore/cli"
@@ -19,7 +19,9 @@ path = "src/main.rs"
19
19
 
20
20
  [dependencies]
21
21
  # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
22
- napi = { version = "2.12.2", default-features = false, features = ["napi4"], optional = true }
22
+ napi = { version = "2.12.2", default-features = false, features = [
23
+ "napi4",
24
+ ], optional = true }
23
25
  napi-derive = { version = "2.12.2", optional = true }
24
26
  inquire = { version = "0.7.5", features = ["editor"] }
25
27
  chalk_rs = "1.0.1"
@@ -30,7 +32,10 @@ ahqstore-types = "2.0.0"
30
32
  reqwest = { version = "0.12", features = ["json", "blocking"] }
31
33
  sha2 = "0.10.8"
32
34
  base64 = "0.22.1"
33
- image = { version = "0.25", default-features = false, features = ["rayon", "png"]}
35
+ image = { version = "0.25", default-features = false, features = [
36
+ "rayon",
37
+ "png",
38
+ ] }
34
39
  rand = "0.8.5"
35
40
 
36
41
  [target.'cfg(unix)'.dependencies]
@@ -38,11 +43,11 @@ openssl-sys = { version = "0.9.102", features = ["vendored"] }
38
43
 
39
44
 
40
45
  [build-dependencies]
41
- napi-build = {version = "2.0.1", optional = true}
46
+ napi-build = { version = "2.0.1", optional = true }
42
47
 
43
48
  [profile.release]
44
49
  lto = true
45
50
  strip = "symbols"
46
51
 
47
52
  [features]
48
- node = ["dep:napi", "dep:napi-build", "dep:napi-derive"]
53
+ node = ["dep:napi", "dep:napi-build", "dep:napi-derive"]
package/index.js CHANGED
@@ -5,255 +5,178 @@
5
5
  /* prettier-ignore */
6
6
 
7
7
  /* auto-generated by NAPI-RS */
8
+ /* and modified by @ahqsoftwares */
8
9
 
9
10
  const { existsSync, readFileSync } = require('fs')
10
- const { join } = require('path')
11
+ const { join } = require("path");
11
12
 
12
- const { platform, arch } = process
13
+ const { platform, arch } = process;
13
14
 
14
- let nativeBinding = null
15
- let localFileExisted = false
16
- let loadError = null
15
+ let nativeBinding = null;
16
+ let localFileExisted = false;
17
+ let loadError = null;
17
18
 
18
19
  function isMusl() {
19
20
  // For Node 10
20
- if (!process.report || typeof process.report.getReport !== 'function') {
21
+ if (!process.report || typeof process.report.getReport !== "function") {
21
22
  try {
22
- const lddPath = require('child_process').execSync('which ldd').toString().trim()
23
- return readFileSync(lddPath, 'utf8').includes('musl')
23
+ const lddPath = require("child_process")
24
+ .execSync("which ldd")
25
+ .toString()
26
+ .trim();
27
+ return readFileSync(lddPath, "utf8").includes("musl");
24
28
  } catch (e) {
25
- return true
29
+ return true;
26
30
  }
27
31
  } else {
28
- const { glibcVersionRuntime } = process.report.getReport().header
29
- return !glibcVersionRuntime
32
+ const { glibcVersionRuntime } = process.report.getReport().header;
33
+ return !glibcVersionRuntime;
30
34
  }
31
35
  }
32
36
 
33
37
  switch (platform) {
34
- case 'android':
38
+ case "win32":
35
39
  switch (arch) {
36
- case 'arm64':
37
- localFileExisted = existsSync(join(__dirname, 'cli.android-arm64.node'))
38
- try {
39
- if (localFileExisted) {
40
- nativeBinding = require('./cli.android-arm64.node')
41
- } else {
42
- nativeBinding = require('@ahqstore/cli-android-arm64')
43
- }
44
- } catch (e) {
45
- loadError = e
46
- }
47
- break
48
- case 'arm':
49
- localFileExisted = existsSync(join(__dirname, 'cli.android-arm-eabi.node'))
50
- try {
51
- if (localFileExisted) {
52
- nativeBinding = require('./cli.android-arm-eabi.node')
53
- } else {
54
- nativeBinding = require('@ahqstore/cli-android-arm-eabi')
55
- }
56
- } catch (e) {
57
- loadError = e
58
- }
59
- break
60
- default:
61
- throw new Error(`Unsupported architecture on Android ${arch}`)
62
- }
63
- break
64
- case 'win32':
65
- switch (arch) {
66
- case 'x64':
40
+ case "x64":
67
41
  localFileExisted = existsSync(
68
- join(__dirname, 'cli.win32-x64-msvc.node')
69
- )
42
+ join(__dirname, "cli.win32-x64-msvc.node")
43
+ );
70
44
  try {
71
45
  if (localFileExisted) {
72
- nativeBinding = require('./cli.win32-x64-msvc.node')
46
+ nativeBinding = require("./cli.win32-x64-msvc.node");
73
47
  } else {
74
- nativeBinding = require('@ahqstore/cli-win32-x64-msvc')
48
+ nativeBinding = require("@ahqstore/cli-win32-x64-msvc");
75
49
  }
76
50
  } catch (e) {
77
- loadError = e
51
+ loadError = e;
78
52
  }
79
- break
80
- case 'ia32':
53
+ break;
54
+ case "ia32":
81
55
  localFileExisted = existsSync(
82
- join(__dirname, 'cli.win32-ia32-msvc.node')
83
- )
56
+ join(__dirname, "cli.win32-ia32-msvc.node")
57
+ );
84
58
  try {
85
59
  if (localFileExisted) {
86
- nativeBinding = require('./cli.win32-ia32-msvc.node')
60
+ nativeBinding = require("./cli.win32-ia32-msvc.node");
87
61
  } else {
88
- nativeBinding = require('@ahqstore/cli-win32-ia32-msvc')
62
+ nativeBinding = require("@ahqstore/cli-win32-ia32-msvc");
89
63
  }
90
64
  } catch (e) {
91
- loadError = e
65
+ loadError = e;
92
66
  }
93
- break
94
- case 'arm64':
67
+ break;
68
+ case "arm64":
95
69
  localFileExisted = existsSync(
96
- join(__dirname, 'cli.win32-arm64-msvc.node')
97
- )
70
+ join(__dirname, "cli.win32-arm64-msvc.node")
71
+ );
98
72
  try {
99
73
  if (localFileExisted) {
100
- nativeBinding = require('./cli.win32-arm64-msvc.node')
74
+ nativeBinding = require("./cli.win32-arm64-msvc.node");
101
75
  } else {
102
- nativeBinding = require('@ahqstore/cli-win32-arm64-msvc')
76
+ nativeBinding = require("@ahqstore/cli-win32-arm64-msvc");
103
77
  }
104
78
  } catch (e) {
105
- loadError = e
79
+ loadError = e;
106
80
  }
107
- break
81
+ break;
108
82
  default:
109
- throw new Error(`Unsupported architecture on Windows: ${arch}`)
83
+ throw new Error(`Unsupported architecture on Windows: ${arch}`);
110
84
  }
111
- break
112
- case 'darwin':
113
- localFileExisted = existsSync(join(__dirname, 'cli.darwin-universal.node'))
85
+ break;
86
+ case "darwin":
87
+ localFileExisted = existsSync(join(__dirname, "cli.darwin-universal.node"));
114
88
  try {
115
89
  if (localFileExisted) {
116
- nativeBinding = require('./cli.darwin-universal.node')
90
+ nativeBinding = require("./cli.darwin-universal.node");
117
91
  } else {
118
- nativeBinding = require('@ahqstore/cli-darwin-universal')
92
+ nativeBinding = require("@ahqstore/cli-darwin-universal");
119
93
  }
120
- break
94
+ break;
121
95
  } catch {}
122
96
  switch (arch) {
123
- case 'x64':
124
- localFileExisted = existsSync(join(__dirname, 'cli.darwin-x64.node'))
97
+ case "x64":
98
+ localFileExisted = existsSync(join(__dirname, "cli.darwin-x64.node"));
125
99
  try {
126
100
  if (localFileExisted) {
127
- nativeBinding = require('./cli.darwin-x64.node')
101
+ nativeBinding = require("./cli.darwin-x64.node");
128
102
  } else {
129
- nativeBinding = require('@ahqstore/cli-darwin-x64')
103
+ nativeBinding = require("@ahqstore/cli-darwin-x64");
130
104
  }
131
105
  } catch (e) {
132
- loadError = e
106
+ loadError = e;
133
107
  }
134
- break
135
- case 'arm64':
136
- localFileExisted = existsSync(
137
- join(__dirname, 'cli.darwin-arm64.node')
138
- )
108
+ break;
109
+ case "arm64":
110
+ localFileExisted = existsSync(join(__dirname, "cli.darwin-arm64.node"));
139
111
  try {
140
112
  if (localFileExisted) {
141
- nativeBinding = require('./cli.darwin-arm64.node')
113
+ nativeBinding = require("./cli.darwin-arm64.node");
142
114
  } else {
143
- nativeBinding = require('@ahqstore/cli-darwin-arm64')
115
+ nativeBinding = require("@ahqstore/cli-darwin-arm64");
144
116
  }
145
117
  } catch (e) {
146
- loadError = e
118
+ loadError = e;
147
119
  }
148
- break
120
+ break;
149
121
  default:
150
- throw new Error(`Unsupported architecture on macOS: ${arch}`)
122
+ throw new Error(`Unsupported architecture on macOS: ${arch}`);
151
123
  }
152
- break
153
- case 'freebsd':
154
- throw new Error("Unsupported OS: FreeBSD");
155
- case 'linux':
124
+ break;
125
+ case "linux":
156
126
  switch (arch) {
157
- case 'x64':
158
- if (isMusl()) {
159
- throw new Error("MUSL Bindings are not supported!");
160
- } else {
161
- localFileExisted = existsSync(
162
- join(__dirname, 'cli.linux-x64-gnu.node')
163
- )
164
- try {
165
- if (localFileExisted) {
166
- nativeBinding = require('./cli.linux-x64-gnu.node')
167
- } else {
168
- nativeBinding = require('@ahqstore/cli-linux-x64-gnu')
169
- }
170
- } catch (e) {
171
- loadError = e
172
- }
173
- }
174
- break
175
- case 'arm64':
127
+ case "x64":
176
128
  if (isMusl()) {
177
129
  throw new Error("MUSL Bindings are not supported!");
178
130
  } else {
179
131
  localFileExisted = existsSync(
180
- join(__dirname, 'cli.linux-arm64-gnu.node')
181
- )
132
+ join(__dirname, "cli.linux-x64-gnu.node")
133
+ );
182
134
  try {
183
135
  if (localFileExisted) {
184
- nativeBinding = require('./cli.linux-arm64-gnu.node')
136
+ nativeBinding = require("./cli.linux-x64-gnu.node");
185
137
  } else {
186
- nativeBinding = require('@ahqstore/cli-linux-arm64-gnu')
138
+ nativeBinding = require("@ahqstore/cli-linux-x64-gnu");
187
139
  }
188
140
  } catch (e) {
189
- loadError = e
141
+ loadError = e;
190
142
  }
191
143
  }
192
- break
193
- case 'arm':
144
+ break;
145
+ case "arm64":
194
146
  if (isMusl()) {
195
147
  throw new Error("MUSL Bindings are not supported!");
196
148
  } else {
197
149
  localFileExisted = existsSync(
198
- join(__dirname, 'cli.linux-arm-gnueabihf.node')
199
- )
150
+ join(__dirname, "cli.linux-arm64-gnu.node")
151
+ );
200
152
  try {
201
153
  if (localFileExisted) {
202
- nativeBinding = require('./cli.linux-arm-gnueabihf.node')
154
+ nativeBinding = require("./cli.linux-arm64-gnu.node");
203
155
  } else {
204
- nativeBinding = require('@ahqstore/cli-linux-arm-gnueabihf')
156
+ nativeBinding = require("@ahqstore/cli-linux-arm64-gnu");
205
157
  }
206
158
  } catch (e) {
207
- loadError = e
159
+ loadError = e;
208
160
  }
209
161
  }
210
- break
211
- case 'riscv64':
212
- if (isMusl()) {
213
- throw new Error("MUSL Bindings are not supported!");
214
- } else {
215
- localFileExisted = existsSync(
216
- join(__dirname, 'cli.linux-riscv64-gnu.node')
217
- )
218
- try {
219
- if (localFileExisted) {
220
- nativeBinding = require('./cli.linux-riscv64-gnu.node')
221
- } else {
222
- nativeBinding = require('@ahqstore/cli-linux-riscv64-gnu')
223
- }
224
- } catch (e) {
225
- loadError = e
226
- }
227
- }
228
- break
229
- case 's390x':
230
- localFileExisted = existsSync(
231
- join(__dirname, 'cli.linux-s390x-gnu.node')
232
- )
233
- try {
234
- if (localFileExisted) {
235
- nativeBinding = require('./cli.linux-s390x-gnu.node')
236
- } else {
237
- nativeBinding = require('@ahqstore/cli-linux-s390x-gnu')
238
- }
239
- } catch (e) {
240
- loadError = e
241
- }
242
- break
162
+ break;
243
163
  default:
244
- throw new Error(`Unsupported architecture on Linux: ${arch}`)
164
+ throw new Error(`Unsupported architecture on Linux: ${arch}`);
245
165
  }
246
- break
166
+ break;
247
167
  default:
248
- throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
168
+ throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
249
169
  }
250
170
 
251
171
  if (!nativeBinding) {
252
172
  if (loadError) {
253
- throw loadError
173
+ throw loadError;
254
174
  }
255
- throw new Error(`Failed to load native binding`)
175
+ throw new Error(`Failed to load native binding`);
256
176
  }
257
177
 
258
- const { node_entrypoint } = nativeBinding
178
+ const { nodeEntrypoint } = nativeBinding;
179
+
180
+ const args = process.argv.slice(2) || [];
259
181
 
182
+ nodeEntrypoint(args, process.env["GH_ACTION"] != null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahqstore/cli",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "napi": {
5
5
  "name": "cli",
6
6
  "triples": {
@@ -16,8 +16,7 @@
16
16
  },
17
17
  "license": "MIT",
18
18
  "devDependencies": {
19
- "@napi-rs/cli": "^2.18.3",
20
- "ava": "^6.0.1"
19
+ "@napi-rs/cli": "^2.18.3"
21
20
  },
22
21
  "ava": {
23
22
  "timeout": "3m"
@@ -36,19 +35,18 @@
36
35
  "build": "napi build --platform --release --features node",
37
36
  "build:debug": "napi build --platform --features node",
38
37
  "prepublishOnly": "napi prepublish -t npm",
39
- "test": "ava",
40
38
  "universal": "napi universal",
41
39
  "version": "napi version"
42
40
  },
43
41
  "optionalDependencies": {
44
- "@ahqstore/cli-win32-x64-msvc": "0.3.4",
45
- "@ahqstore/cli-darwin-x64": "0.3.4",
46
- "@ahqstore/cli-linux-x64-gnu": "0.3.4",
47
- "@ahqstore/cli-darwin-arm64": "0.3.4",
48
- "@ahqstore/cli-linux-arm64-gnu": "0.3.4",
49
- "@ahqstore/cli-win32-arm64-msvc": "0.3.4",
50
- "@ahqstore/cli-win32-ia32-msvc": "0.3.4",
51
- "@ahqstore/cli-darwin-universal": "0.3.4",
52
- "@ahqstore/cli-linux-riscv64-gnu": "0.3.4"
42
+ "@ahqstore/cli-win32-x64-msvc": "0.3.5",
43
+ "@ahqstore/cli-darwin-x64": "0.3.5",
44
+ "@ahqstore/cli-linux-x64-gnu": "0.3.5",
45
+ "@ahqstore/cli-darwin-arm64": "0.3.5",
46
+ "@ahqstore/cli-linux-arm64-gnu": "0.3.5",
47
+ "@ahqstore/cli-win32-arm64-msvc": "0.3.5",
48
+ "@ahqstore/cli-win32-ia32-msvc": "0.3.5",
49
+ "@ahqstore/cli-darwin-universal": "0.3.5",
50
+ "@ahqstore/cli-linux-riscv64-gnu": "0.3.5"
53
51
  }
54
52
  }
package/cli-rs/Cargo.toml DELETED
@@ -1,45 +0,0 @@
1
- [package]
2
- name = "ahqstore_cli_rs"
3
- version = "0.2.8"
4
- edition = "2021"
5
- description = "AHQ Store CLI"
6
- repository = "https://github.com/ahqstore/cli"
7
- homepage = "https://github.com/ahqstore/cli"
8
- license = "MIT"
9
- exclude = ["dist/**", ".ahqstore/**", "finalize.js", "tslink.toml"]
10
- readme = "README.md"
11
-
12
- [lib]
13
- name = "ahqstore_cli_rs"
14
- crate-type = ["cdylib"]
15
- path = "src/lib.rs"
16
-
17
- [[bin]]
18
- name = "ahqstore"
19
- path = "src/main.rs"
20
-
21
- [dependencies]
22
- node-bindgen = { version = "6.0.1", optional = true }
23
- tslink = { version = "0.1.3", optional = true }
24
- inquire = { version = "0.7.5", features = ["editor"] }
25
- chalk_rs = "1.0.1"
26
- lazy_static = "1.4.0"
27
- serde = { version = "1.0.203", features = ["derive"] }
28
- serde_json = "1.0.117"
29
- ahqstore-types = "2.0.0"
30
- reqwest = { version = "0.12", features = ["json", "blocking"] }
31
- sha2 = "0.10.8"
32
- base64 = "0.22.1"
33
- image = "0.25"
34
- rand = "0.8.5"
35
-
36
- [target.aarch64-unknown-linux-gnu.dependencies]
37
- openssl = { version = "0.10.64", features = ["vendored"] }
38
-
39
- [build-dependencies]
40
- node-bindgen = { version = "6.0.1", default-features = false, features = [
41
- "build",
42
- ], optional = true }
43
-
44
- [features]
45
- node = ["dep:node-bindgen", "dep:tslink"]
package/cli-rs/README.md DELETED
@@ -1,41 +0,0 @@
1
- # AHQ Store CLI
2
-
3
- The CLI for devs making AHQ Store Apps
4
-
5
- This version: CARGO
6
-
7
- Install
8
-
9
- ```sh
10
- $ cargo install ahqstore_cli_rs
11
- ```
12
-
13
- ## Help Command
14
-
15
- The help command shows all available commands
16
-
17
- ```sh
18
- $ ahqstore --help
19
- ```
20
-
21
- ## Create .ahqstore config
22
-
23
- Creates the .ahqstore/\* config files to make your app ready to be built
24
-
25
- ```sh
26
- $ ahqstore --create {--force}
27
- ```
28
-
29
- ## Build a project
30
-
31
- Builds your app based on the config files and environment variables
32
- ENV:
33
-
34
- > `APP_ID` (Optional) Application Id (only required if your config has more than 1 appIds)
35
- > `RELEASE_ID` GitHub Release Id
36
- > `GH_TOKEN` GitHub Personal Access Token / GitHub Actions Token
37
- > `GITHUB_REPOSITORY` GitHub owner & repo name, eg ahqstore/app
38
-
39
- ```sh
40
- $ ahqstore build
41
- ```
package/cli-rs/build.rs DELETED
@@ -1,4 +0,0 @@
1
- fn main() {
2
- #[cfg(feature = "node")]
3
- node_bindgen::build::configure();
4
- }
@@ -1,25 +0,0 @@
1
- const { writeFileSync, readFileSync } = require("fs");
2
- const { join } = require("path");
3
- let arch = process.env.arch || require("process").arch;
4
-
5
- if (arch == "arm64" && process.platform == "win32") {
6
- arch = "ia32";
7
- }
8
-
9
- const packageJson = join(__dirname, "dist", "package.json");
10
-
11
- let json = JSON.parse(readFileSync(packageJson));
12
-
13
- json.name = `@ahqstore/cli-rs-${process.platform}-${arch}`;
14
-
15
- json.description = `AHQ Store CLI Binaries for ${process.platform}-${arch}`;
16
- json.repository = {
17
- type: "git",
18
- url: "git+https://github.com/ahqstore/cli.git",
19
- };
20
- json.bugs = {
21
- url: "https://github.com/ahqstore/cli/issues",
22
- };
23
- json.homepage = "https://github.com/ahqstore/cli#readme";
24
-
25
- writeFileSync(packageJson, JSON.stringify(json, null, 2));
@@ -1,2 +0,0 @@
1
- [toolchain]
2
- channel = "nightly"
@@ -1,54 +0,0 @@
1
- use std::{env, fs, process};
2
-
3
- use serde_json::from_str;
4
-
5
- use crate::app::{
6
- shared::{Config, Finder, IMetadata},
7
- ERR,
8
- };
9
-
10
- use super::{GHAsset, GHRelease};
11
-
12
- pub fn get_config<'a>() -> IMetadata<'a> {
13
- let Ok(config) = fs::read_to_string("./.ahqstore/config.json") else {
14
- ERR.println(&"Unable to read config file!");
15
- process::exit(1);
16
- };
17
- let config = config.leak();
18
- let Ok(mut config) = from_str::<'a, Config>(config) else {
19
- ERR.println(&"Unable to read config file!");
20
- process::exit(1);
21
- };
22
-
23
- if let Ok(app_id) = env::var("APP_ID") {
24
- config.remove(&app_id).expect("Key not present in JSON")
25
- } else {
26
- config.into_values().nth(0).expect("No Key present in JSON")
27
- }
28
- }
29
-
30
- pub fn find_assets<'a>(gh_r: &'a GHRelease, finder: &'a Finder) -> Vec<&'a GHAsset> {
31
- gh_r
32
- .assets
33
- .iter()
34
- .filter(|a| {
35
- if let Some(x) = finder.startsWith {
36
- if !a.name.starts_with(&x) {
37
- return false;
38
- }
39
- }
40
- if let Some(x) = finder.contains {
41
- if !a.name.contains(&x) {
42
- return false;
43
- }
44
- }
45
- if let Some(x) = finder.endsWith {
46
- if !a.name.ends_with(&x) {
47
- return false;
48
- }
49
- }
50
-
51
- true
52
- })
53
- .collect::<Vec<_>>()
54
- }
@@ -1,48 +0,0 @@
1
- use crate::app::ERR;
2
- use base64::engine::{general_purpose::STANDARD, Engine};
3
- use image::{load_from_memory_with_format as load_img, ImageFormat};
4
- use std::fs;
5
- use std::process;
6
-
7
- pub fn get_icon(uid: &str) -> String {
8
- let base_img = format!("./.ahqstore/images/{uid}/icon.png");
9
-
10
- let Ok(icon) = fs::read(&base_img) else {
11
- ERR.println(&"Unable to read icon file!");
12
- process::exit(1);
13
- };
14
-
15
- validate_png(&icon);
16
-
17
- STANDARD.encode(&icon)
18
- }
19
-
20
- pub fn get_images(uid: &str) -> Vec<String> {
21
- let base_img = format!("./.ahqstore/images/{uid}");
22
-
23
- let Ok(image_dir) = fs::read_dir(&base_img) else {
24
- ERR.println(&"Unable to read image dir!");
25
- process::exit(1);
26
- };
27
-
28
- let mut entries = image_dir
29
- .map(|res| res.expect("Unable to unwrap dir entry").path())
30
- .filter(|f| !f.ends_with("icon.png"))
31
- .map(|res| fs::read(res).expect("Unable to read bytes"))
32
- .map(|img| {
33
- validate_png(&img);
34
- return STANDARD.encode(&img);
35
- })
36
- .collect::<Vec<_>>();
37
-
38
- entries.truncate(10);
39
-
40
- entries
41
- }
42
-
43
- pub fn validate_png(data: &Vec<u8>) {
44
- let Ok(_) = load_img(&data, ImageFormat::Png) else {
45
- ERR.println(&"Invalid PNG");
46
- process::exit(1);
47
- };
48
- }