Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix setup moonbit scripts for the latest release #34

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions nu/moonbit.nu
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ export def 'setup moonbit' [
version: string = 'latest', # The version of moonbit toolchain to setup, and `latest` by default
--setup-core(-c), # Setup moonbit core
] {
let MOONBIT_HOME = [$nu.home-path .moon] | path join
let MOONBIT_BIN_DIR = [$nu.home-path .moon bin] | path join
let MOONBIT_LIB_DIR = [$nu.home-path .moon lib] | path join
let coreDir = $'($MOONBIT_LIB_DIR)/core'
if not ($MOONBIT_BIN_DIR | path exists) { mkdir $MOONBIT_BIN_DIR }
if not ($MOONBIT_LIB_DIR | path exists) { mkdir $MOONBIT_LIB_DIR }

cd $MOONBIT_BIN_DIR
cd $MOONBIT_HOME
let OS_INFO = $'($nu.os-info.name)_($nu.os-info.arch)'
let archive = $ARCH_TARGET_MAP | get -i $OS_INFO
if ($archive | is-empty) { print $'Unsupported Platform: ($OS_INFO)'; exit 2 }
Expand All @@ -68,11 +69,11 @@ export def 'setup moonbit' [

if (windows?) {
fetch-release $version $'moonbit-($archive).zip'
unzip -q $'moonbit-($archive).zip' -d $MOONBIT_BIN_DIR
unzip -q $'moonbit-($archive).zip' -d $MOONBIT_HOME
rm moonbit*.zip
} else {
fetch-release $version $'moonbit-($archive).tar.gz'
tar xf $'moonbit-($archive).tar.gz' --directory $MOONBIT_BIN_DIR
tar xf $'moonbit-($archive).tar.gz' --directory $MOONBIT_HOME
const IGNORE = [libtcc1.a]
ls $MOONBIT_BIN_DIR
| get name
Expand Down
Loading