Skip to content

Commit

Permalink
feat(docs): update docs
Browse files Browse the repository at this point in the history
Updates the Wing docs. See details in [workflow run].

[Workflow Run]: https://github.com/winglang/docsite/actions/runs/11267043323

------

*Automatically created via the "update-docs" workflow*

Signed-off-by: monabot <monabot@monada.co>
  • Loading branch information
monadabot committed Oct 10, 2024
1 parent f1b99b6 commit 795fcea
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ image: /img/wing-by-example.png
```js playground example title="main.w"
bring fs;

let filename: str = "/tmp/test.txt";
let filename: str = fs.join(@dirname, "test.txt");

log(fs.exists(filename));

Expand All @@ -29,6 +29,8 @@ fs.appendFile(filename, "testing");
let extendedValue = fs.readFile(filename);

log(extendedValue);

fs.remove(filename);
```
```bash title="Wing console output"
Expand Down
4 changes: 2 additions & 2 deletions example_versioned_docs/version-latest/32-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ image: /img/wing-by-example.png

Wing incorporates a [lightweight testing framework](/docs/concepts/tests), which is built around the `wing test` command and the `test` keyword.

```js playground example title="main.w"
```js playground example{valid: false} title="main.w"
bring math;
bring cloud;
let b = new cloud.Bucket();
Expand All @@ -31,7 +31,7 @@ test "bucket starts empty" {
}

test "this test fails" {
throw("test throws an exception fails");
throw "test throws an exception fails";
}
```

Expand Down
26 changes: 15 additions & 11 deletions example_versioned_docs/version-latest/35-exec-processes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@ image: /img/wing-by-example.png
```js playground example title="main.w"
bring util;

let output = util.exec("echo", ["-n", "Hello, Wing!"]);
let dir = @dirname;

// exec with custom environment variables
let output2 = util.exec("bash", ["--norc", "--noprofile", "-c", "echo $WING_TARGET $ENV_VAR"], { env: { ENV_VAR: "Wing" } });
test "exec()" {
let output = util.exec("echo", ["-n", "Hello, Wing!"]);

// exec with inherited environment variables
let output3 = util.exec("bash", ["--norc", "--noprofile", "-c", "echo $WING_TARGET $ENV_VAR"], { inheritEnv: true });
// exec with custom environment variables
let output2 = util.exec("bash", ["--norc", "--noprofile", "-c", "echo $WING_TARGET $ENV_VAR"], { env: { ENV_VAR: "Wing" } });

// exec with current working directory
let output4 = util.exec("bash", ["--norc", "--noprofile", "-c", "echo Hello"], { cwd: "/tmp" });
// exec with inherited environment variables
let output3 = util.exec("bash", ["--norc", "--noprofile", "-c", "echo $WING_TARGET $ENV_VAR"], { inheritEnv: true });

log(output);
log(output2);
log(output3);
log(output4);
// exec with custom working directory
let output4 = util.exec("bash", ["--norc", "--noprofile", "-c", "echo Hello"], { cwd: dir });

log(output);
log(output2);
log(output3);
log(output4);
}
```

```bash title="Wing console output"
Expand Down
2 changes: 1 addition & 1 deletion versioned_docs/version-latest/02-concepts/04-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ test "bucket starts empty" {
}

test "this test should fail" {
throw("test throws an exception fails");
throw "test throws an exception fails";
}
```

Expand Down

0 comments on commit 795fcea

Please sign in to comment.