Skip to content

Commit

Permalink
wip: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Jan 3, 2025
1 parent 0eaf4d8 commit 256f2fa
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 14 deletions.
41 changes: 41 additions & 0 deletions .ghjk/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .ghjk/lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
}
]
},
"bciqgcwltl3sbuyrqlhxz2spihe2asdzrgt3axosw3mre7ived23syhy": {
"bciqnerbswitlqt27ado74puxt3faxea6jaxe4wvytnzwjpupig25kky": {
"provides": [
{
"ty": "posix.envVar",
Expand All @@ -440,7 +440,7 @@
{
"ty": "posix.envVar",
"key": "RUSTY_V8_MIRROR",
"val": "/var/home/asdf/repos/ecma/ghjk/.dev/rusty_v8"
"val": "/home/yohe/ghjk/.dev/rusty_v8"
},
{
"ty": "ghjk.ports.InstallSetRef",
Expand All @@ -453,7 +453,7 @@
"envsNamed": {
"main": "bciqfnku2tswsz4gapwhys5ox5uiyzcb5r7bmuwzljjeziljcu7efroi",
"_rust": "bciqex5g2cetqvfipwhu6fb3mmyke3y6jvrscjrykf2zl7wfwupiqhca",
"dev": "bciqgcwltl3sbuyrqlhxz2spihe2asdzrgt3axosw3mre7ived23syhy"
"dev": "bciqnerbswitlqt27ado74puxt3faxea6jaxe4wvytnzwjpupig25kky"
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
{
"tasks": {
"test": "cargo build -p ghjk && deno test --unstable-worker-options --unstable-kv -A tests/*",
"test-doc": "cargo build -p ghjk && deno test --unstable-worker-options --unstable-kv -A --doc **/*.ts",
"self": "cargo run -p ghjk",
"cache": "deno cache deps/*",
"check": "deno run -A ./tools/check.ts",
"dev": "deno run -A ./tools/dev.ts"
},
"test": {
"exclude": [
".git",
".dev",
"install.ts",
"./target",
".ghjk/**",
".deno-dir/**",
"vendor/**",
"./src/deno_systems/bindings.ts",
"./src/ghjk/js",
"./files/deno/bindings.ts",
"./tools"
]
},
"fmt": {
"exclude": [
".git",
Expand Down
1 change: 0 additions & 1 deletion deps/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

export * from "./common.ts";

export * as cliffy_cmd from "https://deno.land/x/[email protected]/command/mod.ts";
export { Table } from "https://deno.land/x/[email protected]/table/table.ts";
17 changes: 9 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ INSTALLER_URL="https://raw.githubusercontent.com/$ORG/$REPO/main/install.sh"
RELEASE_URL="https://github.com/$ORG/$REPO/releases"

LATEST_VERSION=$(curl "$RELEASE_URL/latest" -s -L -I -o /dev/null -w '%{url_effective}')
LATEST_VERSION="${LATEST_VERSION##*v}"

PLATFORM="${PLATFORM:-}"
TMP_DIR=$(mktemp -d)
Expand All @@ -31,7 +30,9 @@ VERSION="${VERSION:-$LATEST_VERSION}"

# make sure the version is prepended with v
if [ "${VERSION#"v"}" = "$VERSION" ]; then
VERSION="v$VERSION"
cat >&2 <<EOF
WARN: Resolved version "$VERSION" doesn't have "v" prefix.
EOF
fi

if [ "${PLATFORM:-x}" = "x" ]; then
Expand Down Expand Up @@ -78,8 +79,8 @@ fi

printf "Detected version: %s\n" "$VERSION"

ASSET="$NAME-v$VERSION-$PLATFORM"
DOWNLOAD_URL="$RELEASE_URL/download/v$VERSION/$ASSET.$EXT"
ASSET="$NAME-$VERSION-$PLATFORM"
DOWNLOAD_URL="$RELEASE_URL/download/$VERSION/$ASSET.$EXT"

if curl --fail --silent --location --tlsv1.2 --proto '=https' --output "$TMP_DIR/$ASSET.$EXT" "$DOWNLOAD_URL"; then
printf "Downloaded successfully: %s\n" "$ASSET.$EXT"
Expand All @@ -92,12 +93,12 @@ To continue with installation, please make sure the release exists in:
$DOWNLOAD_URL
Then set the PLATFORM and VERSION environment variables, and re-run this script:
$ curl -fsSL $INSTALLER_URL | PLATFORM=x86_64-unknown-linux-musl VERSION=0.1.10 bash
$ curl -fsSL $INSTALLER_URL | PLATFORM=x86_64-unknown-linux-musl VERSION=v0.1.10 bash
EOF
exit 1
fi

tar -C "$TMP_DIR" -xzf "$TMP_DIR/$ASSET.$EXT" "$EXE"
tar -C "$TMP_DIR" -xvzf "$TMP_DIR/$ASSET.$EXT" "$EXE"
chmod +x "$TMP_DIR/$EXE"

if [ "${GHJK_INSTALL_EXEC_DIR}" = "." ]; then
Expand All @@ -119,16 +120,16 @@ EOF
printf "Press enter to continue (or cancel with Ctrl+C):" >&2
read -r _throwaway
mv "$TMP_DIR/$EXE" "$GHJK_INSTALL_EXEC_DIR"
rm -r "$TMP_DIR"
else
echo "$GHJK_INSTALL_EXEC_DIR is not writable."
exit 1
fi
fi

GHJK_INSTALLER_URL="${GHJK_INSTALLER_URL:-https://raw.github.com/$ORG/$REPO/$VERSION/install.ts}"
"$TMP_DIR/$EXE" deno run -A "$GHJK_INSTALLER_URL"
"$GHJK_INSTALL_EXEC_DIR/$EXE" deno run -A "$GHJK_INSTALLER_URL"

rm -r "$TMP_DIR"

SHELL_TYPE=$(basename "$SHELL")

Expand Down
3 changes: 1 addition & 2 deletions src/ghjk/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ impl Config {
.join(&format!("{}/", cwd.file_name().unwrap().to_string_lossy()))
.wrap_err("repo url error")?
} else {
const BASE_URL: &str =
"https://raw.githubusercontent.com/metatypedev/metatype/";
const BASE_URL: &str = "https://raw.githubusercontent.com/metatypedev/ghjk/";
// repo root url must end in slash due to
// how Url::join works
let url = BASE_URL.to_owned() + crate::shadow::COMMIT_HASH + "/";
Expand Down

0 comments on commit 256f2fa

Please sign in to comment.