Support for wasmer
This commit is contained in:
parent
cc029484d6
commit
fc01e74f44
23
bin/update
23
bin/update
|
@ -233,6 +233,21 @@ update-rust() {
|
|||
|
||||
}
|
||||
|
||||
update-wasm() {
|
||||
command -v wasmer > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
start_wasm_update=`date +%s`
|
||||
|
||||
wasmer self-update
|
||||
|
||||
seconds=$((`date +%s` - $start_wasm_update ))
|
||||
formatted=`date -ud "@$seconds" +'%H hours %M minutes %S seconds'`
|
||||
echo -e "\033[32;1m=== Wasm updated in $formatted ===\033[0m"
|
||||
}
|
||||
|
||||
update-npm() {
|
||||
|
||||
# Update node packages if installed
|
||||
|
@ -323,6 +338,7 @@ _print_usage() {
|
|||
echo -e "\033[33mSUBCOMMANDS:\033[0m"
|
||||
echo -e " \033[32msystem\033[0m Updates the system (Debian, Archlinux, Fedora)"
|
||||
echo -e " \033[32mrust\033[0m Updates rust and rust packages (requires rustup)"
|
||||
echo -e " \033[32mwasm\033[0m Updates wasmer"
|
||||
echo -e " \033[32mnpm\033[0m Updates npm packages (in ~/.config/npmbin)"
|
||||
echo -e " \033[32mdotfiles\033[0m Updates the dotfiles"
|
||||
echo -e " \033[32mneovim\033[0m Updates the neovim packages"
|
||||
|
@ -336,6 +352,7 @@ partial-test() {
|
|||
case $1 in
|
||||
"system") return 0;;
|
||||
"rust") return 0;;
|
||||
"wasm") return 0;;
|
||||
"npm") return 0;;
|
||||
"dotfiles") return 0;;
|
||||
"neovim") return 0;;
|
||||
|
@ -351,6 +368,7 @@ partial-requires-lock() {
|
|||
case $1 in
|
||||
"system") return 0;;
|
||||
"rust") return 0;;
|
||||
"wasm") return 0;;
|
||||
"npm") return 0;;
|
||||
"dotfiles") return 0;;
|
||||
"neovim") return 0;;
|
||||
|
@ -366,6 +384,7 @@ partial-update() {
|
|||
case $1 in
|
||||
"system") update-system;;
|
||||
"rust") update-rust;;
|
||||
"wasm") update-wasm;;
|
||||
"npm") update-npm;;
|
||||
"dotfiles") update-dotfiles;;
|
||||
"neovim") update-neovim;;
|
||||
|
@ -396,6 +415,10 @@ main() {
|
|||
_check_running
|
||||
update-rust
|
||||
|
||||
# Update wasmer
|
||||
_check_running
|
||||
update-wasm
|
||||
|
||||
# Update npm and npm packages
|
||||
_check_running
|
||||
update-npm
|
||||
|
|
|
@ -21,7 +21,8 @@ fi
|
|||
# Wasmer path
|
||||
if [ -d $HOME/.wasmer ]; then
|
||||
export WASMER_DIR="$HOME/.wasmer"
|
||||
[ -s "$WASMER_DIR/wasmer.sh" ] && source "$WASMER_DIR/wasmer.sh" # This loads wasmer
|
||||
export WASMER_CACHE_DIR="$WASMER_DIR/cache"
|
||||
export PATH="$WASMER_DIR/bin:$WASMER_DIR/globals/wapm_packages/.bin:$PATH"
|
||||
fi
|
||||
|
||||
# Node path
|
||||
|
|
Loading…
Reference in New Issue