Skip to content

Commit da8e7d3

Browse files
committed
Keep version detection sample in global & base
1 parent f656c50 commit da8e7d3

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

docs/Runtime Environment/Global & Base.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ This page documents the changes & additions to Pluto's runtime environment, whic
88
### `_PVERSION`
99
`_PVERSION` is the global to check your current version of Pluto.
1010

11+
```pluto
12+
if _PVERSION == nil then
13+
print("Plain Lua detected (".._VERSION..")")
14+
else
15+
io.write("Pluto detected (".._PVERSION.."), based on ".._VERSION)
16+
if os.platform then
17+
io.write(", running on "..os.platform)
18+
end
19+
io.write("\n")
20+
end
21+
```
22+
1123
---
1224
### `package.path`
1325
`package.path` is modified to also search for `.pluto` files.

docs/Runtime Environment/OS.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
This page documents the changes & additions to the `os` library in Pluto, which is built on top of Lua 5.4's.
22

3+
---
34
### `os.platform`
45
`os.platform` is a global string containing the host platform. Can be "windows", "wasm", "linux", "macos", "android", or "unknown".
56

6-
```pluto
7-
if _PVERSION == nil then
8-
print("Plain Lua detected (".._VERSION..")")
9-
else
10-
io.write("Pluto detected (".._PVERSION.."), based on ".._VERSION)
11-
if os.platform then
12-
io.write(", running on "..os.platform)
13-
end
14-
io.write("\n")
15-
end
16-
```
17-
187
---
198
### `os.arch`
20-
219
`os.arch` is a global string containing the host CPU architecture as well as the bit width, separated by a comma. For example, it would be `x86, 64-bit` for x86_64, `arm, 64-bit` for ARM64, and `wasm, 32-bit` for a typical WebAssembly environment.
2210

2311
---

0 commit comments

Comments
 (0)