eitri-cli 1.10.0-beta.1 → 1.10.0-beta.2

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.
@@ -1,17 +1,25 @@
1
- use std::process::exit;
1
+ use std::{env, process::exit};
2
2
 
3
3
  use crate::{
4
4
  model::{url::Url, workspace_auth::WorkspaceAuth},
5
5
  services::eitri_foundry,
6
6
  };
7
7
 
8
- pub async fn execute(
9
- _workspace_auth: WorkspaceAuth,
10
- _path: String,
11
- ){
8
+ pub async fn execute(_workspace_auth: WorkspaceAuth, _path: String) {
9
+ let path = env::var("FOUNDRY_CONTEXT_PATH")
10
+ .ok()
11
+ .and_then(|context_path| {
12
+ if context_path.is_empty() {
13
+ Some(String::from("foundry/run-test"))
14
+ } else {
15
+ Some(format!("{}/run-test", context_path))
16
+ }
17
+ })
18
+ .unwrap_or_else(|| String::from("foundry/run-test"));
19
+
12
20
  let url = Url {
13
21
  host: String::from("https://api.eitri.tech/"),
14
- path: String::from("runes-foundry/run-test"),
22
+ path: path,
15
23
  };
16
24
  let result = eitri_foundry::run_test(_workspace_auth, _path, url).await;
17
25
 
@@ -20,8 +28,8 @@ pub async fn execute(
20
28
  let output_str = output.stderr;
21
29
  eprint!("{output_str}");
22
30
  }
23
- Err(error) => {
24
- eprintln!("Houve um erro ao executar os testes: {:?}", error);
31
+ Err(_) => {
32
+ eprintln!("Houve um erro ao executar os testes.");
25
33
  exit(1)
26
34
  }
27
35
  }
@@ -19,7 +19,6 @@ pub async fn run_test(
19
19
  };
20
20
 
21
21
  headers.append("workspace-id", user_workspace_id.parse().unwrap());
22
-
23
22
  let result = http_client::post::<ProcessOutput, TestConfig>(&url, data, headers).await?;
24
23
 
25
24
  Ok(result)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.10.0-beta.1",
3
+ "version": "1.10.0-beta.2",
4
4
  "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
5
  "main": "index.js",
6
6
  "bin": {