2021-12-21 23:20:20 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-11-30 23:58:54 +03:00
|
|
|
mkdir -p ./artifacts_cli
|
2021-12-21 23:20:20 +03:00
|
|
|
# Naive substitution to napi artifacts for the cli binary.
|
|
|
|
for filename in artifacts/*/*.node
|
|
|
|
do
|
|
|
|
BINDING_NAME=${filename#*.}
|
|
|
|
BINDING_ABI=${BINDING_NAME%%.*}
|
|
|
|
CLI_BINARY_PATH=${filename%%.*}
|
|
|
|
|
2022-12-12 06:50:09 +03:00
|
|
|
echo "Preparing build artifacts:"
|
|
|
|
echo "Binding name $BINDING_NAME"
|
|
|
|
echo "Filename $filename"
|
|
|
|
echo "Cli binary path $CLI_BINARY_PATH"
|
|
|
|
|
2021-12-21 23:20:20 +03:00
|
|
|
if [ -f "$CLI_BINARY_PATH" ]; then
|
2022-07-28 06:10:08 +03:00
|
|
|
chmod +x $CLI_BINARY_PATH
|
2022-12-30 09:31:57 +03:00
|
|
|
mv -v $CLI_BINARY_PATH ./artifacts_cli/swc-$BINDING_ABI
|
2022-07-28 06:10:08 +03:00
|
|
|
elif [ -f "$CLI_BINARY_PATH.exe" ]; then
|
2022-12-30 09:31:57 +03:00
|
|
|
mv -v $CLI_BINARY_PATH.exe ./artifacts_cli/swc-$BINDING_ABI.exe
|
2021-12-21 23:20:20 +03:00
|
|
|
fi
|
|
|
|
done
|