Skip to content

Commit f656c50

Browse files
well-in-that-caseSainan
authored andcommitted
Move os.platform & os.arch into os docs
1 parent 8ae02a9 commit f656c50

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

docs/Runtime Environment/Global & Base.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,6 @@ 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-
### `os.platform`
12-
`os.platform` is a global string containing the host platform. Can be "windows", "wasm", "linux", "macos", "android", or "unknown".
13-
14-
```pluto
15-
if _PVERSION == nil then
16-
print("Plain Lua detected (".._VERSION..")")
17-
else
18-
io.write("Pluto detected (".._PVERSION.."), based on ".._VERSION)
19-
if os.platform then
20-
io.write(", running on "..os.platform)
21-
end
22-
io.write("\n")
23-
end
24-
```
25-
26-
### `os.arch`
27-
28-
`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.
29-
3011
---
3112
### `package.path`
3213
`package.path` is modified to also search for `.pluto` files.

docs/Runtime Environment/OS.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
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+
### `os.platform`
4+
`os.platform` is a global string containing the host platform. Can be "windows", "wasm", "linux", "macos", "android", or "unknown".
5+
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+
18+
---
19+
### `os.arch`
20+
21+
`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.
22+
323
---
424
### `os.sleep`
525
#### Parameters

0 commit comments

Comments
 (0)