Skip to content

Commit c8ac177

Browse files
committed
README: fix install guide
1 parent c5fa7fc commit c8ac177

File tree

14 files changed

+18
-1931
lines changed

14 files changed

+18
-1931
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ dune build -p moonbit-lang
3939

4040
## Use Wasm-based MoonBit Compiler
4141

42-
First, you need to install Node.js. Then, run the following commands in the root directory of this repository:
42+
First, you need to install Node.js and curl. Then, run the following commands in a temp directory:
4343

4444
```shell
45+
curl -fSL -O https://github.com/moonbitlang/moonbit-compiler/releases/latest/download/moonbit-wasm.tar.gz
46+
tar -zxvf moonbit-wasm.tar.gz
4547
mkdir -p $HOME/.moon
46-
MOON_VERSION=$(cat ./node/moon_version)
48+
MOON_VERSION=$(cat ./moon_version)
4749
MOON_HOME="$HOME/.moon"
4850
BIN_DIR="$MOON_HOME/bin"
4951
mkdir -p "$BIN_DIR"
@@ -53,7 +55,9 @@ git reset --hard "$MOON_VERSION"
5355
cargo build --release
5456
cp target/release/moon "$BIN_DIR"
5557
cp target/release/moonrun "$BIN_DIR"
56-
pushd node
58+
sed -i '1 i #!/usr/bin/env -S node --stack-size=4096' moonc.js
59+
sed -i '1 i #!/usr/bin/env -S node --stack-size=4096' moonfmt.js
60+
sed -i '1 i #!/usr/bin/env -S node --stack-size=4096' mooninfo.js
5761
cp moonc.js moonfmt.js mooninfo.js moonc.assets moonfmt.assets mooninfo.assets "$BIN_DIR" -r
5862
mv "$BIN_DIR/moonc.js" "$BIN_DIR/moonc"
5963
mv "$BIN_DIR/moonfmt.js" "$BIN_DIR/moonfmt"
@@ -62,13 +66,11 @@ chmod +x "$BIN_DIR/moonc"
6266
chmod +x "$BIN_DIR/moonfmt"
6367
chmod +x "$BIN_DIR/mooninfo"
6468
cp lib include "$MOON_HOME"
65-
popd
66-
CORE_VERSION=$(cat ./node/core_version)
69+
CORE_VERSION=$(cat ./core_version)
6770
git clone https://github.com/moonbitlang/core "$MOON_HOME/lib/core"
68-
pushd "$MOON_HOME/lib/core"
71+
cd "$MOON_HOME/lib/core"
6972
git reset --hard "$CORE_VERSION"
7073
moon bundle --target all
71-
popd
7274
```
7375

7476
## Contributing

README.zh.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ dune build -p moonbit-lang
3939

4040
## 使用wasm版的MoonBit编译器
4141

42-
首先需要安装nodejs, 然后在本仓库的根目录下执行以下命令
42+
首先需要安装nodejs和curl, 然后在任意的临时目录下执行以下命令
4343

4444
```shell
45+
curl -fSL -O https://github.com/moonbitlang/moonbit-compiler/releases/latest/download/moonbit-wasm.tar.gz
46+
tar -zxvf moonbit-wasm.tar.gz
4547
mkdir -p $HOME/.moon
46-
MOON_VERSION=$(cat ./node/moon_version)
48+
MOON_VERSION=$(cat ./moon_version)
4749
MOON_HOME="$HOME/.moon"
4850
BIN_DIR="$MOON_HOME/bin"
4951
mkdir -p "$BIN_DIR"
@@ -53,7 +55,9 @@ git reset --hard "$MOON_VERSION"
5355
cargo build --release
5456
cp target/release/moon "$BIN_DIR"
5557
cp target/release/moonrun "$BIN_DIR"
56-
pushd node
58+
sed -i '1 i #!/usr/bin/env -S node --stack-size=4096' moonc.js
59+
sed -i '1 i #!/usr/bin/env -S node --stack-size=4096' moonfmt.js
60+
sed -i '1 i #!/usr/bin/env -S node --stack-size=4096' mooninfo.js
5761
cp moonc.js moonfmt.js mooninfo.js moonc.assets moonfmt.assets mooninfo.assets "$BIN_DIR" -r
5862
mv "$BIN_DIR/moonc.js" "$BIN_DIR/moonc"
5963
mv "$BIN_DIR/moonfmt.js" "$BIN_DIR/moonfmt"
@@ -62,13 +66,11 @@ chmod +x "$BIN_DIR/moonc"
6266
chmod +x "$BIN_DIR/moonfmt"
6367
chmod +x "$BIN_DIR/mooninfo"
6468
cp lib include "$MOON_HOME"
65-
popd
66-
CORE_VERSION=$(cat ./node/core_version)
69+
CORE_VERSION=$(cat ./core_version)
6770
git clone https://github.com/moonbitlang/core "$MOON_HOME/lib/core"
68-
pushd "$MOON_HOME/lib/core"
71+
cd "$MOON_HOME/lib/core"
6972
git reset --hard "$CORE_VERSION"
7073
moon bundle --target all
71-
popd
7274
```
7375

7476
## 贡献

node/core_version

Lines changed: 0 additions & 1 deletion
This file was deleted.

node/include/moonbit-fundamental.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

node/include/moonbit.h

Lines changed: 0 additions & 155 deletions
This file was deleted.

0 commit comments

Comments
 (0)