From 2971f432b0da0d787507ed098d5bbfd417d6f949 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 23 Jun 2019 10:21:53 +0800 Subject: fix tip and warn --- manual/builtin_modules.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manual/builtin_modules.md') diff --git a/manual/builtin_modules.md b/manual/builtin_modules.md index ab178572..c46104fd 100644 --- a/manual/builtin_modules.md +++ b/manual/builtin_modules.md @@ -7,7 +7,7 @@ on_run(function (target) end) ``` -

+

In order to ensure that the description field of the outer layer is as simple and secure as possible, it is generally not recommended to use the interface and module operation api in this domain. Therefore, most module interfaces can only be used in the script domain to implement complex functions.
Of course, a small number of read-only built-in interfaces can still be used in the description field, as shown in the following table:

@@ -634,7 +634,7 @@ The system operation module belongs to the built-in module. It can be called dir This module is also a native module of lua, and xmake has been extended to provide more practical interfaces. -

+

Only some readonly interfaces (for example: `os.getenv`, `os.arch`) in the os module can be used in the description field. Other interfaces can only be used in the script domain, for example: `os.cp`, `os .rm`etc.

@@ -898,7 +898,7 @@ os.run("echo hello %s!", "xmake") os.run("ls -l $(buildir)") ``` -

+

Using this interface to execute shell commands can easily reduce the cross-platform build. For `os.run("cp ..")`, try to use `os.cp` instead.
If you must use this interface to run the shell program, please use the [config.plat](#config-plat) interface to determine the platform support.

-- cgit v1.2.3