Skip to content

Commit 07c69f0

Browse files
authored
feat: add installPath option for mise installation and create install-path test scenario
1 parent 2565e24 commit 07c69f0

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

src/mise/devcontainer-feature.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"default": "latest",
1111
"description": "Install a specific version"
1212
},
13+
"installPath": {
14+
"type": "string",
15+
"default": "/usr/local/bin/mise",
16+
"description": "Path to install mise"
17+
},
1318
"activate": {
1419
"type": "string",
1520
"proposals": ["none", "path", "shims"],

src/mise/install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ set -e
33

44
MISE_CLI_INSTALLER_GPG_KEY="0x7413A06D"
55

6-
# Installer options
7-
export MISE_INSTALL_PATH="/usr/local/bin/mise"
8-
96
# Feature options
107
if [ ! "$VERSION" = "latest" ]; then
118
export MISE_VERSION="$VERSION"
129
fi
1310
if [ "$INSTALL" = "true" ]; then
1411
TRUST="true"
1512
fi
13+
# mise installer options
14+
export MISE_INSTALL_PATH="${INSTALLPATH:-/usr/local/bin/mise}"
1615

1716
if [ "$(id -u)" -ne 0 ]; then
1817
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'

test/mise/install-path.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source dev-container-features-test-lib
5+
6+
check "testing config was trusted" bash -c '[ -x /tmp/mise ]'
7+
8+
reportResults

test/mise/scenarios.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,13 @@
9696
}
9797
},
9898
"updateContentCommand": "echo 'tools.bat = \"latest\"' > mise.toml"
99+
},
100+
"install-path": {
101+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
102+
"features": {
103+
"mise": {
104+
"installPath": "/tmp/mise"
105+
}
106+
}
99107
}
100108
}

0 commit comments

Comments
 (0)