Skip to content

Commit 21cab2a

Browse files
committed
update README
1 parent a426cc9 commit 21cab2a

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

README.zh.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,30 @@ dune build -p moonbit-lang
4242
首先需要安装nodejs, 然后在本仓库的根目录下执行以下命令
4343

4444
```shell
45-
INSTALL_DIR="$HOME/.moon/bin"
46-
cp node/* "$INSTALL_DIR" -r
47-
mv "$INSTALL_DIR/moonc.js" "$INSTALL_DIR/moonc"
48-
mv "$INSTALL_DIR/moonfmt.js" "$INSTALL_DIR/moonfmt"
49-
mv "$INSTALL_DIR/mooninfo.js" "$INSTALL_DIR/mooninfo"
50-
chmod +x "$INSTALL_DIR/moonc"
51-
chmod +x "$INSTALL_DIR/moonfmt"
52-
chmod +x "$INSTALL_DIR/mooninfo"
53-
# 重新打包core
54-
pushd "$HOME/.moon/lib/core"
55-
moon clean
45+
mkdir -p $HOME/.moon
46+
MOON_VERSION=$(cat ./node/moon_version)
47+
MOON_HOME="$HOME/.moon"
48+
BIN_DIR="$MOON_HOME/bin"
49+
mkdir -p "$BIN_DIR"
50+
git clone https://github.com/moonbitlang/moon
51+
cd moon
52+
git reset --hard "$MOON_VERSION"
53+
cargo build --release
54+
cp target/release/moon "$BIN_DIR"
55+
pushd node
56+
cp moonc.js moonfmt.js mooninfo.js moonc.assets moonfmt.assets mooninfo.assets "$BIN_DIR" -r
57+
mv "$BIN_DIR/moonc.js" "$BIN_DIR/moonc"
58+
mv "$BIN_DIR/moonfmt.js" "$BIN_DIR/moonfmt"
59+
mv "$BIN_DIR/mooninfo.js" "$BIN_DIR/mooninfo"
60+
chmod +x "$BIN_DIR/moonc"
61+
chmod +x "$BIN_DIR/moonfmt"
62+
chmod +x "$BIN_DIR/mooninfo"
63+
cp lib include "$MOON_HOME"
64+
popd
65+
CORE_VERSION=$(cat ./node/core_version)
66+
git clone https://github.com/moonbitlang/core "$MOON_HOME/lib/core"
67+
pushd "$MOON_HOME/lib/core"
68+
git reset --hard "$CORE_VERSION"
5669
moon bundle --target all
5770
popd
5871
```

0 commit comments

Comments
 (0)