Skip to content

Commit

Permalink
fix: install.sh upgrade_is_ok check (#17)
Browse files Browse the repository at this point in the history
* fix: install.sh upgrade_is_ok check

* chore: run cobalt build
  • Loading branch information
TheEdward162 authored Jul 25, 2023
1 parent 99b039e commit fa746b4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions _site/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ <h2>Overview</h2>
<h2>Set Up</h2>
<p>Install the <code>cobalt</code> CLI:</p>
<pre style="background-color:#2b303b;">
<span style="color:#c0c5ce;">$ cargo install cobalt-bin
</span></pre>
<code><span style="color:#c0c5ce;">$ cargo install cobalt-bin
</span></code></pre>
<h2>Building</h2>
<p>To re-build the <code>wasmtime.dev</code> website, run</p>
<pre style="background-color:#2b303b;">
<span style="color:#c0c5ce;">cobalt build
</span></pre>
<code><span style="color:#c0c5ce;">cobalt build
</span></code></pre>
<p>The built site will be in <code>_site/</code>.</p>
<h2>Development</h2>
<p>To start a local server and rebuild the website whenever a file is changed, run</p>
<pre style="background-color:#2b303b;">
<span style="color:#c0c5ce;">cobalt serve
</span></pre>
<code><span style="color:#c0c5ce;">cobalt serve
</span></code></pre>
<p>and visit http://localhost:1024/ in your browser.</p>
20 changes: 10 additions & 10 deletions _site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ <h2>Install</h2>
<p>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.</p>
<pre style="background-color:#2b303b;">
<span style="color:#8fa1b3;">curl</span><span style="color:#c0c5ce;"> https://wasmtime.dev/install.sh</span><span style="color:#bf616a;"> -sSf </span><span style="color:#c0c5ce;">| </span><span style="color:#8fa1b3;">bash
</span></pre>
<code><span style="color:#8fa1b3;">curl</span><span style="color:#c0c5ce;"> https://wasmtime.dev/install.sh</span><span style="color:#bf616a;"> -sSf </span><span style="color:#c0c5ce;">| </span><span style="color:#8fa1b3;">bash
</span></code></pre>
<p>You can also download binaries directly from the <a href="https://github.com/bytecodealliance/wasmtime/releases">GitHub
Releases</a> page.</p>
</div>
Expand All @@ -87,15 +87,15 @@ <h2>Install</h2>
<p>If you’re a Windows Subsystem for Linux user run the following in your terminal,
then follow the on-screen instructions to install Wasmtime.</p>
<pre style="background-color:#2b303b;">
<span style="color:#8fa1b3;">curl</span><span style="color:#c0c5ce;"> https://wasmtime.dev/install.sh</span><span style="color:#bf616a;"> -sSf </span><span style="color:#c0c5ce;">| </span><span style="color:#8fa1b3;">bash
</span></pre>
<code><span style="color:#8fa1b3;">curl</span><span style="color:#c0c5ce;"> https://wasmtime.dev/install.sh</span><span style="color:#bf616a;"> -sSf </span><span style="color:#c0c5ce;">| </span><span style="color:#8fa1b3;">bash
</span></code></pre>
</div>
<div id="platform-instructions-default" class="db">
<p>If you’re running macOS or Linux, download and install Wasmtime by running the
following in your terminal and following the on-screen instructions.</p>
<pre style="background-color:#2b303b;">
<span style="color:#8fa1b3;">curl</span><span style="color:#c0c5ce;"> https://wasmtime.dev/install.sh</span><span style="color:#bf616a;"> -sSf </span><span style="color:#c0c5ce;">| </span><span style="color:#8fa1b3;">bash
</span></pre>
<code><span style="color:#8fa1b3;">curl</span><span style="color:#c0c5ce;"> https://wasmtime.dev/install.sh</span><span style="color:#bf616a;"> -sSf </span><span style="color:#c0c5ce;">| </span><span style="color:#8fa1b3;">bash
</span></code></pre>
<hr />
<p>If you are running Windows, download and run the <a href="https://github.com/bytecodealliance/wasmtime/releases/download/dev/wasmtime-dev-x86_64-windows.msi">Wasmtime
Installer</a>
Expand All @@ -113,17 +113,17 @@ <h2>Example</h2>
installed</a> then you can take some Rust
source code:</p>
<pre style="background-color:#2b303b;">
<span style="color:#b48ead;">fn </span><span style="color:#8fa1b3;">main</span><span style="color:#c0c5ce;">() {
<code><span style="color:#b48ead;">fn </span><span style="color:#8fa1b3;">main</span><span style="color:#c0c5ce;">() {
</span><span style="color:#c0c5ce;"> println!(&quot;</span><span style="color:#a3be8c;">Hello, world!</span><span style="color:#c0c5ce;">&quot;);
</span><span style="color:#c0c5ce;">}
</span></pre>
</span></code></pre>
<p>and compile/run it with:</p>
<pre style="background-color:#2b303b;">
<span style="color:#8fa1b3;">$</span><span style="color:#c0c5ce;"> rustup target add wasm32-wasi
<code><span style="color:#8fa1b3;">$</span><span style="color:#c0c5ce;"> rustup target add wasm32-wasi
</span><span style="color:#8fa1b3;">$</span><span style="color:#c0c5ce;"> rustc hello.rs</span><span style="color:#bf616a;"> --target</span><span style="color:#c0c5ce;"> wasm32-wasi
</span><span style="color:#8fa1b3;">$</span><span style="color:#c0c5ce;"> wasmtime hello.wasm
</span><span style="color:#8fa1b3;">Hello,</span><span style="color:#c0c5ce;"> world!
</span></pre>
</span></code></pre>
</div>
</section>
<section>
Expand Down
4 changes: 2 additions & 2 deletions _site/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa746b4

Please sign in to comment.