File tree 1 file changed +16
-3
lines changed
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,6 @@ export def 'setup moonbit' [
64
64
cd $MOONBIT_BIN_DIR
65
65
let OS_INFO = $' ($nu .os-info.name )_($nu .os-info.arch )'
66
66
let archive = $ARCH_TARGET_MAP | get - i $OS_INFO
67
- let moonBin = if (windows ? ) { ' moon.exe' } else { ' moon' }
68
67
if ($archive | is-empty ) { print $' Unsupported Platform: ($OS_INFO )' ; exit 2 }
69
68
70
69
print $' (char nl )Setup moonbit toolchain of version: (ansi g )($version )(ansi reset )' ; hr-line
@@ -103,8 +102,7 @@ export def 'setup moonbit' [
103
102
if $version == ' bleeding' {
104
103
if ($coreDir | path exists ) { rm - rf $coreDir }
105
104
git clone -- depth 1 https://github.com/moonbitlang/core.git $coreDir
106
- ^$moonBin bundle -- all -- source-dir $coreDir
107
- ^$moonBin bundle -- target wasm-gc -- source-dir $coreDir -- quiet
105
+ bundle-core $coreDir
108
106
return
109
107
}
110
108
@@ -115,8 +113,23 @@ export def 'setup moonbit' [
115
113
} else {
116
114
tar xf core*.tar.gz -- directory $MOONBIT_LIB_DIR ; rm core*.tar.gz
117
115
}
116
+ bundle-core $coreDir
117
+ }
118
+ }
119
+
120
+ # Bundle moonbit core
121
+ def bundle-core [coreDir : string ] {
122
+ let moonBin = if (windows ? ) { ' moon.exe' } else { ' moon' }
123
+ print $' (char nl )Bundle moonbit core(ansi reset )' ; hr-line
124
+ try {
118
125
^$moonBin bundle -- all -- source-dir $coreDir
126
+ } catch {
127
+ print $' (ansi red )Failed to bundle core(ansi reset )'
128
+ }
129
+ try {
119
130
^$moonBin bundle -- target wasm-gc -- source-dir $coreDir -- quiet
131
+ } catch {
132
+ print $' (ansi red )Failed to bundle core to wasm-gc(ansi reset )'
120
133
}
121
134
}
122
135
You can’t perform that action at this time.
0 commit comments