@@ -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
4547mkdir -p $HOME /.moon
46- MOON_VERSION=$( cat ./node/ moon_version)
48+ MOON_VERSION=$( cat ./moon_version)
4749MOON_HOME=" $HOME /.moon"
4850BIN_DIR=" $MOON_HOME /bin"
4951mkdir -p " $BIN_DIR "
@@ -53,7 +55,9 @@ git reset --hard "$MOON_VERSION"
5355cargo build --release
5456cp target/release/moon " $BIN_DIR "
5557cp 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
5761cp moonc.js moonfmt.js mooninfo.js moonc.assets moonfmt.assets mooninfo.assets " $BIN_DIR " -r
5862mv " $BIN_DIR /moonc.js" " $BIN_DIR /moonc"
5963mv " $BIN_DIR /moonfmt.js" " $BIN_DIR /moonfmt"
@@ -62,13 +66,11 @@ chmod +x "$BIN_DIR/moonc"
6266chmod +x " $BIN_DIR /moonfmt"
6367chmod +x " $BIN_DIR /mooninfo"
6468cp lib include " $MOON_HOME "
65- popd
66- CORE_VERSION=$( cat ./node/core_version)
69+ CORE_VERSION=$( cat ./core_version)
6770git clone https://github.com/moonbitlang/core " $MOON_HOME /lib/core"
68- pushd " $MOON_HOME /lib/core"
71+ cd " $MOON_HOME /lib/core"
6972git reset --hard " $CORE_VERSION "
7073moon bundle --target all
71- popd
7274```
7375
7476## Contributing
0 commit comments