Skip to content

Commit eef778c

Browse files
committed
Fix mfc wrapper script: add toolchain symlink and build directory
The wrapper script now: 1. Creates a toolchain symlink so mfc.sh can verify it's in MFC root folder 2. Creates a build directory with venv symlink for mfc.sh to write to 3. Prevents 'You must call this script from within MFC's root folder' error This ensures the mfc command works properly when called from any location.
1 parent 6235b8a commit eef778c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packaging/homebrew/mfc.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def install
6464
# Create smart wrapper script that:
6565
# 1. Works around read-only Cellar issue
6666
# 2. Activates venv automatically so cantera/dependencies are available
67+
# 3. Sets up toolchain symlink so mfc.sh can find toolchain/util.sh
6768
(bin/"mfc").write <<~EOS
6869
#!/bin/bash
6970
set -e
@@ -80,6 +81,13 @@ def install
8081
cp "#{libexec}/mfc.sh" "$TMPDIR/"
8182
cd "$TMPDIR"
8283
84+
# Create toolchain symlink so mfc.sh can verify it's in MFC root folder
85+
ln -s "#{prefix}/toolchain" toolchain
86+
87+
# Create build directory for mfc.sh to write to (with pre-existing venv symlink)
88+
mkdir -p build
89+
ln -s "#{venv}" build/venv
90+
8391
# Run mfc.sh with all arguments
8492
exec ./mfc.sh "$@"
8593
EOS

0 commit comments

Comments
 (0)