From fa746b4c20126744a892277819f800cbd14255fa Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 25 Jul 2023 18:42:48 +0200 Subject: [PATCH] fix: install.sh upgrade_is_ok check (#17) * fix: install.sh upgrade_is_ok check * chore: run cobalt build --- _site/README.html | 12 ++++++------ _site/index.html | 20 ++++++++++---------- _site/install.sh | 4 ++-- install.sh | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/_site/README.html b/_site/README.html index a9c9fe8..d479fc2 100644 --- a/_site/README.html +++ b/_site/README.html @@ -36,17 +36,17 @@

Overview

Set Up

Install the cobalt CLI:

-$ cargo install cobalt-bin
-
+$ cargo install cobalt-bin +

Building

To re-build the wasmtime.dev website, run

-cobalt build
-
+cobalt build +

The built site will be in _site/.

Development

To start a local server and rebuild the website whenever a file is changed, run

-cobalt serve
-
+cobalt serve +

and visit http://localhost:1024/ in your browser.

diff --git a/_site/index.html b/_site/index.html index 973715e..d2948bd 100644 --- a/_site/index.html +++ b/_site/index.html @@ -75,8 +75,8 @@

Install

It looks like you’re running macOS or Linux. To download and install Wasmtime, run the following in your terminal, then follow the on-screen instructions.

-curl https://wasmtime.dev/install.sh -sSf | bash
-
+curl https://wasmtime.dev/install.sh -sSf | bash +

You can also download binaries directly from the GitHub Releases page.

@@ -87,15 +87,15 @@

Install

If you’re a Windows Subsystem for Linux user run the following in your terminal, then follow the on-screen instructions to install Wasmtime.

-curl https://wasmtime.dev/install.sh -sSf | bash
-
+curl https://wasmtime.dev/install.sh -sSf | bash +

If you’re running macOS or Linux, download and install Wasmtime by running the following in your terminal and following the on-screen instructions.

-curl https://wasmtime.dev/install.sh -sSf | bash
-
+curl https://wasmtime.dev/install.sh -sSf | bash +

If you are running Windows, download and run the Wasmtime Installer @@ -113,17 +113,17 @@

Example

installed then you can take some Rust source code:

-fn main() {
+fn main() {
     println!("Hello, world!");
 }
-
+

and compile/run it with:

-$ rustup target add wasm32-wasi
+$ rustup target add wasm32-wasi
 $ rustc hello.rs --target wasm32-wasi
 $ wasmtime hello.wasm
 Hello, world!
-
+
diff --git a/_site/install.sh b/_site/install.sh index ac36a4f..6c8d14d 100644 --- a/_site/install.sh +++ b/_site/install.sh @@ -229,13 +229,13 @@ upgrade_is_ok() { local install_dir="$2" local is_dev_install="$3" - local wasmtime_bin="$install_dir/wasmtime" + local wasmtime_bin="$install_dir/bin/wasmtime" if [[ -n "$install_dir" && -x "$wasmtime_bin" ]]; then local prev_version="$( ($wasmtime_bin --version 2>/dev/null || echo 0.1) | sed -E 's/^.*([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')" # if this is a local dev install, skip the equality check # if installing the same version, this is a no-op - if [ "$is_dev_install" != "true" ] && [ "$prev_version" == "$will_install_version" ]; then + if [ "$is_dev_install" != "true" ] && [ "v$prev_version" == "$will_install_version" ]; then eprintf "Version $will_install_version already installed" return 1 fi diff --git a/install.sh b/install.sh index ac36a4f..6c8d14d 100644 --- a/install.sh +++ b/install.sh @@ -229,13 +229,13 @@ upgrade_is_ok() { local install_dir="$2" local is_dev_install="$3" - local wasmtime_bin="$install_dir/wasmtime" + local wasmtime_bin="$install_dir/bin/wasmtime" if [[ -n "$install_dir" && -x "$wasmtime_bin" ]]; then local prev_version="$( ($wasmtime_bin --version 2>/dev/null || echo 0.1) | sed -E 's/^.*([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')" # if this is a local dev install, skip the equality check # if installing the same version, this is a no-op - if [ "$is_dev_install" != "true" ] && [ "$prev_version" == "$will_install_version" ]; then + if [ "$is_dev_install" != "true" ] && [ "v$prev_version" == "$will_install_version" ]; then eprintf "Version $will_install_version already installed" return 1 fi