Skip to content

Commit

Permalink
test: added shebang to e2e scripts (#2159)
Browse files Browse the repository at this point in the history
this just makes my editor know it is bash
  • Loading branch information
jdx committed May 20, 2024
1 parent 9a56129 commit bed68c4
Show file tree
Hide file tree
Showing 68 changed files with 69 additions and 68 deletions.
2 changes: 1 addition & 1 deletion e2e/assert.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

# shellcheck source-path=SCRIPTDIR
source "$TEST_ROOT/style.sh"
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_activate_path_safety
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

eval "$(mise activate bash)" && eval "$(mise hook-env)"
install -m 0755 /dev/null "$TMPDIR/MISE_PATH_SAFETY_CHECK"
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_doctor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

mise use dummy@latest

Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_env_file
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<'EOF' >.mise.toml
[env]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_env_file_glob
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<'EOF' >.mise.toml
[env]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_env_json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd jq

cat >.mise.toml <<EOF
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_env_path
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

mise use dummy@1.0.0
assert_contains "mise env -s bash | grep PATH" "/installs/dummy/1.0.0/bin"
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_env_source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat >"$MISE_CONFIG_DIR/config.toml" <<EOF
[env]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_env_source_glob
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat >.mise.toml <<EOF
[env]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_env_template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<EOF >.mise.toml
[env]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_exec_chdir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

mkdir direnv

Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_global
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_contains "mise global dummy@2.0.0" "~/.config/mise/config.toml"
assert "cat ~/.config/mise/config.toml" '[tools]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_global_alt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_contains "MISE_GLOBAL_CONFIG_FILE=~/.mise.global.toml mise global dummy@latest" "~/.mise.global.toml"
assert "cat ~/.mise.global.toml" '[tools]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_hook_env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

mise i dummy@{1.0.0,1.1.0,2.0.0}

Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_install_raw
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_contains 'mise i --raw -f dummy@1 2>&1' "~/.local/share/mise/plugins/dummy/bin/install"
assert_contains 'MISE_RAW=1 mise i -f dummy@1 2>&1' "~/.local/share/mise/plugins/dummy/bin/install"
2 changes: 1 addition & 1 deletion e2e/cli/test_link
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

# Systematically installed by run_test
rm "$MISE_DATA_DIR/plugins/dummy"
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_USE_TOML=0

Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_local_toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_USE_TOML=1

Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_log_level
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_contains "mise x dummy@latest --log-level debug -- dummy 2>&1" "[DEBUG]"
assert_contains "mise x dummy@latest --log-level=debug -- dummy 2>&1" "[DEBUG]"
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_ls_remote
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_contains "mise ls-remote dummy" '1.0.0
1.1.0
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<EOF >.mise.toml
[tasks.configtask]
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_shims
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export PATH="$MISE_DATA_DIR/shims:$PATH"

Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_uninstall
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export CLICOLOR=0

Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_upgrade
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

echo 'dummy 1' >.tool-versions
mise install dummy@1.0.0
Expand Down
2 changes: 1 addition & 1 deletion e2e/cli/test_use
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

mise i dummy@1.0.0

Expand Down
2 changes: 1 addition & 1 deletion e2e/config/test_tool_versions_alt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_DEFAULT_TOOL_VERSIONS_FILENAME=.alternate-tool-versions
export MISE_DEFAULT_CONFIG_FILENAME=.MISSING
Expand Down
2 changes: 1 addition & 1 deletion e2e/direnv/test_direnv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd direnv

# Create a "local" dummy binary
Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_cargo_binstall
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd cargo

export MISE_CARGO_BINSTALL=1
Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_cargo_binstall_token
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

unset GITHUB_TOKEN GITHUB_API_TOKEN

Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_cargo_compile_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd cargo

export MISE_CARGO_BINSTALL=0
Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_go_install_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

eval "$(mise activate bash --shims)"
mise use go@prefix:1.20
Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_npm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd npm

export NPM_CONFIG_FUND=false
Expand Down
3 changes: 2 additions & 1 deletion e2e/forge/test_pipx_deep_dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# shellcheck shell=bash disable=SC2016,SC2034
#!/usr/bin/env bash
# shellcheck disable=SC2016,SC2034

# Create system "tools" that always fail and push them to the front of PATH
cat >"$HOME/bin/fail" <<'EOF'
Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_pipx_direct_dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd python3

# Create a system pipx that always fail and push it to the front of PATH
Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_pipx_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd pipx

assert_contains "mise x pipx:black@22.6.0 -- black --version" "22.6.0"
Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_ubi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

curl -sSf -L https://github.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh | TARGET="$HOME/bin" sh

Expand Down
2 changes: 1 addition & 1 deletion e2e/forge/test_ubi_token
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

unset GITHUB_TOKEN GITHUB_API_TOKEN

Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_bun
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<EOF >.bun-version
1.0.17
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_deno
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

if [[ "${MISE_DISABLE_TOOLS:-}" = *deno* ]]; then
warn "Skipping deno tests"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_erlang_slow
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_contains "mise x erlang@24.3.4.9 -- erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell" "24"
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_GO_DEFAULT_PACKAGES_FILE="$HOME/.default-go-packages"

Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_gopath
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

echo "golang 1.20" >.tool-versions
mkdir 21
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<EOF >.sdkmanrc
java=17.0.2
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_java_corretto
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_contains "mise x java@corretto-8 -- java -version 2>&1" "Corretto-8"
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_node
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_NODE_COREPACK=1
export MISE_NODE_DEFAULT_PACKAGES_FILE="$PWD/.default-npm-packages"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_poetry_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

# arrange
export MISE_PYTHON_COMPILE=1
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_python_compile_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_PYTHON_COMPILE=1
assert "mise x python@3.12.3 -- python --version" "Python 3.12.3"
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_python_precompiled
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_PYTHON_COMPILE=0
assert_contains "mise use python@3.12.3 2>&1" "precompiled"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_python_venv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

export MISE_PYTHON_DEFAULT_PACKAGES_FILE="$HOME/.default-python-packages"

Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_ruby_build_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
# Install and build ruby using ruby-build

export MISE_RUBY_INSTALL=0
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_ruby_from_gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
# Read ruby version from Gemfile

cat >Gemfile <<EOF
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_ruby_install_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
# Install and build ruby using ruby-install

export MISE_RUBY_INSTALL=1
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_system_node
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd node

system_node="$(which node)"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/core/test_zigmod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

eval "$(mise activate bash)" && eval "$(mise hook-env)"
mise plugin install https://github.com/kachick/asdf-zigmod
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/test_core_overloading
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

mise plugin i -f node https://github.com/mise-plugins/mise-tiny
mise i node@latest
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/test_install
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<EOF >.mise.toml
[plugins]
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/test_plugins_install
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat <<EOF >.tool-versions
tiny latest
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/test_poetry_system_python_slow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

# arrange
export POETRY_HOME="$HOME/.poetry"
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/test_purge
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

echo "tiny 3.1.0" >.tool-versions

Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/test_tiny
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

cat >.mise.toml <<EOF
[tools]
Expand Down
2 changes: 1 addition & 1 deletion e2e/plugins/test_version_range
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

assert_fail "mise current tiny"

Expand Down
2 changes: 1 addition & 1 deletion e2e/shell/fish_script
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
# shellcheck disable=SC1072,SC1065,SC1064,SC1073,SC2103

set -l fish_trace 1
Expand Down
2 changes: 1 addition & 1 deletion e2e/shell/test_bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash
# shellcheck disable=SC2016

orig_path="$PATH"
Expand Down
2 changes: 1 addition & 1 deletion e2e/shell/test_bash_legacy_activate
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

echo "tiny 3.1.0" >.tool-versions
mkdir subdir
Expand Down
2 changes: 1 addition & 1 deletion e2e/shell/test_fish
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd fish
exec fish "$TEST_DIR/fish_script"
2 changes: 1 addition & 1 deletion e2e/shell/test_zsh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# shellcheck shell=bash
#!/usr/bin/env bash
require_cmd zsh
exec zsh "$TEST_DIR/zsh_script"
2 changes: 1 addition & 1 deletion e2e/style.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# shellcheck shell=bash
#!/usr/bin/env bash

if [[ -n ${GITHUB_ACTION:-} ]]; then
# Output Github action annotations
Expand Down
Loading

0 comments on commit bed68c4

Please sign in to comment.