fix: Use dynamic path for release directory in postInstall
Instead of hardcoding the version in the path, find the release directory dynamically. This fixes the 'undefined variable version' error during Docker image build.
This commit is contained in:
parent
a980afa947
commit
d8a0a9ca4d
1 changed files with 13 additions and 8 deletions
|
|
@ -79,15 +79,20 @@ beamPackages.mixRelease {
|
|||
|
||||
# Install MIB files to the release
|
||||
postInstall = ''
|
||||
# Copy MIB files directory
|
||||
if [ -d "$src/priv/mibs" ]; then
|
||||
mkdir -p $out/lib/towerops-${version}/priv/mibs
|
||||
cp -r $src/priv/mibs/* $out/lib/towerops-${version}/priv/mibs/
|
||||
fi
|
||||
# Find the release directory (mixRelease creates lib/<name>-<version>)
|
||||
RELEASE_DIR=$(find $out/lib -maxdepth 1 -type d -name "towerops-*" | head -1)
|
||||
|
||||
# Ensure NIF is in the release
|
||||
mkdir -p $out/lib/towerops-${version}/priv
|
||||
cp ${towerops-nif}/lib/towerops_nif.so $out/lib/towerops-${version}/priv/
|
||||
if [ -n "$RELEASE_DIR" ]; then
|
||||
# Copy MIB files directory
|
||||
if [ -d "$src/priv/mibs" ]; then
|
||||
mkdir -p $RELEASE_DIR/priv/mibs
|
||||
cp -r $src/priv/mibs/* $RELEASE_DIR/priv/mibs/
|
||||
fi
|
||||
|
||||
# Ensure NIF is in the release
|
||||
mkdir -p $RELEASE_DIR/priv
|
||||
cp ${towerops-nif}/lib/towerops_nif.so $RELEASE_DIR/priv/
|
||||
fi
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue