Skip to content

Commit fb786bf

Browse files
committed
Merge branch 'pr-30'
2 parents cad9cde + e6000aa commit fb786bf

File tree

6 files changed

+57
-62
lines changed

6 files changed

+57
-62
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ go.work
2121
dist/
2222

2323
# Built binaries (but not wrapper scripts)
24-
mvx-binary
2524
mvx-dev
2625
/mvx-linux-*
2726
/mvx-darwin-*

.mvx/config.json5

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
build: {
4949
description: "Build mvx binary with platform-optimized settings",
50-
script: "go build -o mvx-binary . && echo 'Installing global development binary...' && mkdir -p ~/.mvx/dev && cp mvx-binary ~/.mvx/dev/mvx && chmod +x ~/.mvx/dev/mvx && echo '✅ Global development binary installed at ~/.mvx/dev/mvx' && echo ' All projects using mvxVersion=dev will now use this binary automatically'",
50+
script: "go build -o mvx-dev . && echo 'Installing global development binary...' && mkdir -p ~/.mvx/dev && cp mvx-dev ~/.mvx/dev/mvx && chmod +x ~/.mvx/dev/mvx && echo '✅ Global development binary installed at ~/.mvx/dev/mvx' && echo ' All projects using mvxVersion=dev will now use this binary automatically'",
5151
override: true
5252
},
5353

@@ -96,13 +96,7 @@
9696

9797
clean: {
9898
description: "Clean build artifacts",
99-
script: "rm -f mvx-binary && rm -rf dist/ && rm -f ~/.mvx/dev/mvx && echo '🧹 Cleaned local and global dev binaries'",
100-
override: true
101-
},
102-
103-
clean: {
104-
description: "Clean build artifacts",
105-
script: "rm -f mvx-binary mvx-dev && rm -rf dist/ && rm -rf .mvx/local/ .mvx/tools/ .mvx/versions/",
99+
script: "rm -f mvx-dev && rm -rf dist/ && rm -f ~/.mvx/dev/mvx && echo '🧹 Cleaned local and global dev binaries'",
106100
override: true
107101
}
108102
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ curl -fsSL https://raw.githubusercontent.com/gnodet/mvx/main/install-mvx.sh | ba
6868
**Install development version (latest features, may be unstable):**
6969

7070
```bash
71-
curl -fsSL https://raw.githubusercontent.com/gnodet/mvx/main/install-mvx.sh | MVX_VERSION=main bash
71+
curl -fsSL https://raw.githubusercontent.com/gnodet/mvx/main/install-mvx.sh | MVX_VERSION=dev bash
7272
```
7373

7474
**Use mvx without global installation:**
@@ -110,7 +110,7 @@ curl -fsSL https://raw.githubusercontent.com/gnodet/mvx/main/install-mvx.sh | ba
110110
**Install development version:**
111111

112112
```bash
113-
curl -fsSL https://raw.githubusercontent.com/gnodet/mvx/main/install-mvx.sh | MVX_VERSION=main bash
113+
curl -fsSL https://raw.githubusercontent.com/gnodet/mvx/main/install-mvx.sh | MVX_VERSION=dev bash
114114
```
115115

116116
**Use mvx without global installation:**

install-mvx.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ if [ -n "$REQUESTED_VERSION" ]; then
1818
echo "🔧 Using specified version: $REQUESTED_VERSION"
1919
BOOTSTRAP_VERSION="$REQUESTED_VERSION"
2020

21-
# If main branch is specified, use development version
22-
if [ "$REQUESTED_VERSION" = "main" ]; then
23-
echo "📦 Installing from main branch (development version)"
21+
# If dev version is specified, use development version
22+
if [ "$REQUESTED_VERSION" = "dev" ]; then
23+
echo "📦 Installing development version"
2424
fi
2525
else
2626
# Get latest release version
2727
echo "🔍 Getting latest release version..."
2828
LATEST_RELEASE=$(curl -s https://api.github.com/repos/gnodet/mvx/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
2929

3030
if [ -z "$LATEST_RELEASE" ]; then
31-
echo "❌ Failed to get latest release, falling back to main branch"
32-
BOOTSTRAP_VERSION="main"
31+
echo "❌ Failed to get latest release, falling back to development version"
32+
BOOTSTRAP_VERSION="dev"
3333
else
3434
echo "📦 Latest release: $LATEST_RELEASE"
3535
BOOTSTRAP_VERSION="$LATEST_RELEASE"
@@ -72,8 +72,8 @@ EOF
7272
fi
7373

7474
# Update the version in the properties file to match the installed version
75-
if [ "$BOOTSTRAP_VERSION" = "main" ]; then
76-
echo "📝 Setting version to 'dev' for main branch in mvx.properties"
75+
if [ "$BOOTSTRAP_VERSION" = "dev" ]; then
76+
echo "📝 Setting version to 'dev' in mvx.properties"
7777
sed -i.bak "s/^mvxVersion=.*/mvxVersion=dev/" .mvx/mvx.properties && rm -f .mvx/mvx.properties.bak
7878

7979
echo ""
@@ -109,8 +109,8 @@ echo " 3. Run './mvx update-bootstrap' to check for updates"
109109
echo " 4. Commit these files to your repository"
110110
echo ""
111111
echo "Advanced usage:"
112-
echo " - Install development version: curl -fsSL ... | MVX_VERSION=main bash"
112+
echo " - Install development version: curl -fsSL ... | MVX_VERSION=dev bash"
113113
echo " - Install specific version: curl -fsSL ... | MVX_VERSION=v0.1.0 bash"
114-
echo " - Or with command line argument: curl -fsSL ... | bash -s main"
114+
echo " - Or with command line argument: curl -fsSL ... | bash -s dev"
115115
echo ""
116116
echo "For more information, see: https://github.com/gnodet/mvx/blob/main/BOOTSTRAP.md"

mvx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ find_mvx_binary() {
346346
echo "Error: Failed to download mvx binary from $download_url" >&2
347347

348348
# Provide helpful guidance for development version
349-
if [ "$version" = "dev" ] || [ "$version" = "main" ]; then
349+
if [ "$version" = "dev" ]; then
350350
echo "" >&2
351351
echo "💡 You're using the development version, but no 'dev' binary is available." >&2
352352
echo " To use mvx in development mode, you need to build it locally:" >&2
@@ -419,37 +419,37 @@ main() {
419419
echo "Requested version: $MVX_VERSION"
420420
fi
421421

422-
# Check for local binaries first, regardless of version
423-
# This allows development version "dev" to work
422+
# Check for local development binaries only when explicitly using dev version
423+
if [ "$MVX_VERSION" = "dev" ]; then
424+
# 1. Check project-specific development binary
425+
local local_binaries="./mvx-dev"
426+
if [ "$platform" = "windows-amd64" ]; then
427+
local_binaries="./mvx-dev.exe"
428+
fi
424429

425-
# 1. Check project-specific development binary
426-
local local_binaries="./mvx-dev"
427-
if [ "$platform" = "windows-amd64" ]; then
428-
local_binaries="./mvx-dev.exe"
429-
fi
430+
for local_binary in $local_binaries; do
431+
if [ -f "$local_binary" ] && [ -x "$local_binary" ]; then
432+
if [ "$verbosity" = "verbose" ]; then
433+
echo "Using project-specific development binary: $local_binary"
434+
echo ""
435+
fi
436+
exec "$local_binary" "$@"
437+
fi
438+
done
430439

431-
for local_binary in $local_binaries; do
432-
if [ -f "$local_binary" ] && [ -x "$local_binary" ]; then
440+
# 2. Check global development binary (shared across all projects)
441+
local global_dev_binary="$home_dir/.mvx/dev/mvx"
442+
if [ "$platform" = "windows-amd64" ]; then
443+
global_dev_binary="$home_dir/.mvx/dev/mvx.exe"
444+
fi
445+
446+
if [ -f "$global_dev_binary" ] && [ -x "$global_dev_binary" ]; then
433447
if [ "$verbosity" = "verbose" ]; then
434-
echo "Using project-specific development binary: $local_binary"
448+
echo "Using global development binary: $global_dev_binary"
435449
echo ""
436450
fi
437-
exec "$local_binary" "$@"
438-
fi
439-
done
440-
441-
# 2. Check global development binary (shared across all projects)
442-
local global_dev_binary="$home_dir/.mvx/dev/mvx"
443-
if [ "$platform" = "windows-amd64" ]; then
444-
global_dev_binary="$home_dir/.mvx/dev/mvx.exe"
445-
fi
446-
447-
if [ -f "$global_dev_binary" ] && [ -x "$global_dev_binary" ]; then
448-
if [ "$verbosity" = "verbose" ]; then
449-
echo "Using global development binary: $global_dev_binary"
450-
echo ""
451+
exec "$global_dev_binary" "$@"
451452
fi
452-
exec "$global_dev_binary" "$@"
453453
fi
454454

455455
# No local binary found, proceed with version resolution and download

mvx.cmd

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,27 @@ if "%VERBOSITY%"=="verbose" (
6565
echo Requested version: %MVX_VERSION_TO_USE%
6666
)
6767

68-
rem Check for local development binary first - always check regardless of version
69-
if exist ".\mvx-dev.exe" (
70-
if "%VERBOSITY%"=="verbose" (
71-
echo Using local development binary: .\mvx-dev.exe
72-
echo.
68+
rem Check for local development binaries only when explicitly using dev version
69+
if "%MVX_VERSION_TO_USE%"=="dev" (
70+
if exist ".\mvx-dev.exe" (
71+
if "%VERBOSITY%"=="verbose" (
72+
echo Using local development binary: .\mvx-dev.exe
73+
echo.
74+
)
75+
".\mvx-dev.exe" %*
76+
goto :eof
7377
)
74-
".\mvx-dev.exe" %*
75-
goto :eof
76-
)
7778

78-
rem Check for global development binary (shared across all projects)
79-
set GLOBAL_DEV_BINARY=%HOME_DIR%\.mvx\dev\mvx.exe
80-
if exist "%GLOBAL_DEV_BINARY%" (
81-
if "%VERBOSITY%"=="verbose" (
82-
echo Using global development binary: %GLOBAL_DEV_BINARY%
83-
echo.
79+
rem Check for global development binary (shared across all projects)
80+
set GLOBAL_DEV_BINARY=%HOME_DIR%\.mvx\dev\mvx.exe
81+
if exist "%GLOBAL_DEV_BINARY%" (
82+
if "%VERBOSITY%"=="verbose" (
83+
echo Using global development binary: %GLOBAL_DEV_BINARY%
84+
echo.
85+
)
86+
"%GLOBAL_DEV_BINARY%" %*
87+
goto :eof
8488
)
85-
"%GLOBAL_DEV_BINARY%" %*
86-
goto :eof
8789
)
8890

8991
rem Resolve version (handle "latest")

0 commit comments

Comments
 (0)