Skip to content

Commit 28c5d97

Browse files
committed
test: handle lib extension names per system
1 parent f3263be commit 28c5d97

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nix/ext/pg_cron.nix

+9-2
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,21 @@ stdenv.mkDerivation {
116116
VERSION=$1
117117
LIB_DIR=$(dirname "$0")/../lib
118118
119+
# Use platform-specific extension
120+
if [ "$(uname)" = "Darwin" ]; then
121+
EXT=".dylib"
122+
else
123+
EXT=".so"
124+
fi
125+
119126
# Check if version exists
120-
if [ ! -f "$LIB_DIR/pg_cron-$VERSION${postgresql.dlSuffix}" ]; then
127+
if [ ! -f "$LIB_DIR/pg_cron-$VERSION$EXT" ]; then
121128
echo "Error: Version $VERSION not found"
122129
exit 1
123130
fi
124131
125132
# Update library symlink
126-
ln -sfnv "pg_cron-$VERSION${postgresql.dlSuffix}" "$LIB_DIR/pg_cron${postgresql.dlSuffix}"
133+
ln -sfnv "pg_cron-$VERSION$EXT" "$LIB_DIR/pg_cron$EXT"
127134
128135
echo "Successfully switched pg_cron to version $VERSION"
129136
EOF

0 commit comments

Comments
 (0)