Skip to content

Commit

Permalink
Merge pull request #4 from axodotdev/some-pr
Browse files Browse the repository at this point in the history
Some pr
  • Loading branch information
Gankra authored Jun 21, 2024
2 parents f6c8452 + e37b5e2 commit 7571d15
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 1,554 deletions.
41 changes: 33 additions & 8 deletions axolotlsay-js/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,34 @@
set -eu

EXE_BASENAME=axolotlsay-js
NODE_VERSION=node18

npm install
install_bun_windows() {
powershell -c "irm bun.sh/install.ps1 | iex"
}

install_bun_unix() {
curl -fsSL https://bun.sh/install | bash
}

# Don't install bun in interactive shells; just assume we have it
if [ -n "${CI:-}" ] && ! type bun >/dev/null; then
case "$(uname -s)" in
MINGW* | MSYS* | CYGWIN* | Windows_NT)
install_bun_windows
;;
*)
install_bun_unix
;;
esac

# So we don't have to reload the config it writes
# Note: this is also valid for Windows, which also places
# it in $HOME
export BUN_INSTALL="$HOME/.bun"
export PATH="$HOME/.bun/bin:$PATH"
fi

bun install

args=

Expand All @@ -14,24 +39,24 @@ args=
if [ -n "${CARGO_DIST_TARGET:-}" ]; then
case "${CARGO_DIST_TARGET}" in
x86_64-pc-windows-msvc)
args="--targets ${NODE_VERSION}-win-x86_64 --output ${EXE_BASENAME}.exe"
args="--target bun-windows-x64 --outfile ${EXE_BASENAME}.exe"
;;
aarch64-apple-darwin)
args="--targets ${NODE_VERSION}-darwin-arm64 --output ${EXE_BASENAME}"
args="--target bun-darwin-arm64 --outfile ${EXE_BASENAME}"
;;
x86_64-apple-darwin)
args="--targets ${NODE_VERSION}-darwin-x86_64 --output ${EXE_BASENAME}"
args="--target bun-darwin-x64 --outfile ${EXE_BASENAME}"
;;
aarch64-unknown-linux-gnu)
args="--targets ${NODE_VERSION}-linux-arm64 --output ${EXE_BASENAME}"
args="--target bun-linux-arm64 --outfile ${EXE_BASENAME}"
;;
x86_64-unknown-linux-gnu)
args="--targets ${NODE_VERSION}-linux-x86_64 --output ${EXE_BASENAME}"
args="--target bun-linux-x64 --outfile ${EXE_BASENAME}"
;;
*)
echo "Platform not supported: ${CARGO_DIST_TARGET}"
exit 1
esac
fi

npm run package -- $args
bun build ./index.js --compile $args
Binary file added axolotlsay-js/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion axolotlsay-js/dist.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "axolotlsay-js"
description = "JavaScript port of axolotlsay"
version = "0.8.0"
version = "0.9.0"
license = "MIT"
repository = "https://github.com/axodotdev/axolotlsay-hybrid"
binaries = ["axolotlsay-js"]
Expand Down
10 changes: 3 additions & 7 deletions axolotlsay-js/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#! /usr/bin/env node
#!/usr/bin/env bun

const yargs = require("yargs/yargs");
const yargs = require("yargs");
const { hideBin } = require("yargs/helpers");
const argv = yargs(hideBin(process.argv)).version(
"--version",
"Show version number",
"0.6.0",
).argv;
const argv = yargs(hideBin(process.argv)).argv;

const msg = argv.msg;
console.log(msg);
Loading

0 comments on commit 7571d15

Please sign in to comment.