Skip to content

Commit

Permalink
style: run lint-fix which has changed slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Mar 16, 2024
1 parent f7456eb commit 6e8dd2f
Show file tree
Hide file tree
Showing 17 changed files with 272 additions and 272 deletions.
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ license = "MIT"
keywords = ["mise"]
categories = ["command-line-utilities"]
include = [
"src/**/*.rs",
"src/plugins/core/assets/**",
"src/assets/**",
"/completions/*",
"/Cargo.lock",
"/LICENSE",
"/README.md",
"/build.rs",
"/zipsign.pub",
"src/**/*.rs",
"src/plugins/core/assets/**",
"src/assets/**",
"/completions/*",
"/Cargo.lock",
"/LICENSE",
"/README.md",
"/build.rs",
"/zipsign.pub",
]
rust-version = "1.74.0"
build = "build.rs"
Expand Down Expand Up @@ -78,9 +78,9 @@ regex = "1.10.3"
reqwest = { version = "0.11.26", default-features = false, features = ["blocking", "json", "gzip"] }
rmp-serde = "1.1.2"
self_update = { version = "0.39.0", default-features = false, features = [
"archive-tar",
"compression-flate2",
"signatures",
"archive-tar",
"compression-flate2",
"signatures",
] }
serde = "1.0.197"
serde_derive = "1.0.197"
Expand All @@ -101,8 +101,8 @@ thiserror = "1.0.58"
toml = { version = "0.8.11", features = ["parse"] }
toml_edit = { version = "0.22.7", features = ["parse"] }
url = "2.5.0"
usage-lib = { version="0.1.9", features = ["clap"] }
versions = { version = "6.1.0" , features=["serde"]}
usage-lib = { version = "0.1.9", features = ["clap"] }
versions = { version = "6.1.0", features = ["serde"] }
walkdir = "2.5.0"
which = "6.0.0"
zip = { version = "0.6.6", default-features = false, features = ["deflate"] }
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

## What is it?

* Like [asdf](https://asdf-vm.com) (or [nvm](https://github.com/nvm-sh/nvm) or [pyenv](https://github.com/pyenv/pyenv) but for any language) it manages [dev tools](https://mise.jdx.dev/dev-tools/) like node, python, cmake, terraform, and [hundreds more](https://mise.jdx.dev/plugins.html).
* Like [direnv](https://github.com/direnv/direnv) it manages [environment variables](https://mise.jdx.dev/environments.html) for different project directories.
* Like [make](https://www.gnu.org/software/make/manual/make.html) it manages [tasks](https://mise.jdx.dev/tasks/) used to build and test projects.
- Like [asdf](https://asdf-vm.com) (or [nvm](https://github.com/nvm-sh/nvm) or [pyenv](https://github.com/pyenv/pyenv) but for any language) it manages [dev tools](https://mise.jdx.dev/dev-tools/) like node, python, cmake, terraform, and [hundreds more](https://mise.jdx.dev/plugins.html).
- Like [direnv](https://github.com/direnv/direnv) it manages [environment variables](https://mise.jdx.dev/environments.html) for different project directories.
- Like [make](https://www.gnu.org/software/make/manual/make.html) it manages [tasks](https://mise.jdx.dev/tasks/) used to build and test projects.

## Migrating from rtx

Expand Down
56 changes: 28 additions & 28 deletions e2e/assert.sh
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
#!/usr/bin/env bash

assert() {
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != "$2" ]]; then
echo "Expected '$2' but got '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != "$2" ]]; then
echo "Expected '$2' but got '$actual'"
exit 1
fi
}

assert_contains() {
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != *"$2"* ]]; then
echo "Expected '$2' to be in '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ "$actual" != *"$2"* ]]; then
echo "Expected '$2' to be in '$actual'"
exit 1
fi
}

assert_not_contains() {
local actual
actual="$(bash -c "$1")"
if [[ "$actual" == *"$2"* ]]; then
echo "Expected '$2' to not be in '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ "$actual" == *"$2"* ]]; then
echo "Expected '$2' to not be in '$actual'"
exit 1
fi
}

assert_fail() {
if bash -c "$1" 2>&1; then
echo "Expected failure but succeeded"
exit 1
fi
if bash -c "$1" 2>&1; then
echo "Expected failure but succeeded"
exit 1
fi
}

assert_matches() {
local actual
actual="$(bash -c "$1")"
if [[ ! "$actual" =~ $2 ]]; then
echo "Expected '$2' to match '$actual'"
exit 1
fi
local actual
actual="$(bash -c "$1")"
if [[ ! "$actual" =~ $2 ]]; then
echo "Expected '$2' to match '$actual'"
exit 1
fi
}
40 changes: 20 additions & 20 deletions scripts/build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ touch mise/lib/.disable-self-update

tar -xvJf "dist/mise-$MISE_VERSION-linux-x64.tar.xz"
fpm -s dir -t deb \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture amd64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture amd64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

tar -xvJf "dist/mise-$MISE_VERSION-linux-arm64.tar.xz"
fpm -s dir -t deb \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture arm64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture arm64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

mkdir -p dist/deb/pool/main
cp -v ./*.deb dist/deb/pool/main
Expand Down
40 changes: 20 additions & 20 deletions scripts/build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ touch mise/lib/.disable-self-update

tar -xvJf "dist/mise-$MISE_VERSION-linux-x64.tar.xz"
fpm -s dir -t rpm \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture x86_64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture x86_64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

tar -xvJf "dist/mise-$MISE_VERSION-linux-arm64.tar.xz"
fpm -s dir -t rpm \
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture aarch64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1
--name mise \
--license MIT \
--version "${MISE_VERSION#v*}" \
--architecture aarch64 \
--description "The front-end to your dev env" \
--url "https://github.com/jdx/mise" \
--maintainer "Jeff Dickey @jdx" \
mise/bin/mise=/usr/bin/mise \
mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \
mise/man/man1/mise.1=/usr/share/man/man1/mise.1

cat <<EOF >~/.rpmmacros
%_signature gpg
Expand Down
114 changes: 57 additions & 57 deletions scripts/build-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,75 @@
set -euo pipefail

error() {
echo "$@" >&2
exit 1
echo "$@" >&2
exit 1
}

NAME="$1"
shift

for arg in "$@"; do
if [ "${next_target:-}" = 1 ]; then
next_target=
TARGET="$arg"
continue
fi
case "$arg" in
--target)
next_target=1
;;
*) ;;
if [ "${next_target:-}" = 1 ]; then
next_target=
TARGET="$arg"
continue
fi
case "$arg" in
--target)
next_target=1
;;
*) ;;

esac
esac
done

RUST_TRIPLE=${TARGET:-$(rustc -vV | grep ^host: | cut -d ' ' -f2)}
#region os/arch
get_os() {
case "$RUST_TRIPLE" in
*-apple-darwin*)
echo "macos"
;;
*-linux-*)
echo "linux"
;;
*)
error "unsupported OS: $RUST_TRIPLE"
;;
esac
case "$RUST_TRIPLE" in
*-apple-darwin*)
echo "macos"
;;
*-linux-*)
echo "linux"
;;
*)
error "unsupported OS: $RUST_TRIPLE"
;;
esac
}

get_arch() {
case "$RUST_TRIPLE" in
aarch64-*)
echo "arm64"
;;
arm-*)
echo "armv6"
;;
armv7-*)
echo "armv7"
;;
x86_64-*)
echo "x64"
;;
universal2-*)
echo "universal"
;;
*)
error "unsupported arch: $RUST_TRIPLE"
;;
esac
case "$RUST_TRIPLE" in
aarch64-*)
echo "arm64"
;;
arm-*)
echo "armv6"
;;
armv7-*)
echo "armv7"
;;
x86_64-*)
echo "x64"
;;
universal2-*)
echo "universal"
;;
*)
error "unsupported arch: $RUST_TRIPLE"
;;
esac
}
get_suffix() {
case "$RUST_TRIPLE" in
*-musl | *-musleabi | *-musleabihf)
echo "-musl"
;;
*)
echo ""
;;
esac
case "$RUST_TRIPLE" in
*-musl | *-musleabi | *-musleabihf)
echo "-musl"
;;
*)
echo ""
;;
esac
}
#endregion

Expand All @@ -79,11 +79,11 @@ VERSION=$(./scripts/get-version.sh)
BASENAME=$NAME-$VERSION-$(get_os)-$(get_arch)$(get_suffix)

if command -v cross >/dev/null; then
cross build "$@"
cross build "$@"
elif command -v zig >/dev/null; then
cargo zigbuild "$@"
cargo zigbuild "$@"
else
cargo build "$@"
cargo build "$@"
fi
mkdir -p dist/mise/bin
mkdir -p dist/mise/man/man1
Expand All @@ -99,8 +99,8 @@ tar -cJf "$BASENAME.tar.xz" mise
tar -czf "$BASENAME.tar.gz" mise

if [ -f ~/.zipsign/mise.priv ]; then
zipsign sign tar "$BASENAME.tar.gz" ~/.zipsign/mise.priv
zipsign verify tar "$BASENAME.tar.gz" ../zipsign.pub
zipsign sign tar "$BASENAME.tar.gz" ~/.zipsign/mise.priv
zipsign verify tar "$BASENAME.tar.gz" ../zipsign.pub
fi

ls -oh "$BASENAME.tar.xz"
Loading

0 comments on commit 6e8dd2f

Please sign in to comment.