1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/app-desktop/testPluginDemo.sh

30 lines
928 B
Bash
Raw Normal View History

#!/bin/bash
# This is a convenient way to build and test a plugin demo.
# It could be used to develop plugins too.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
TEMP_PATH=~/src/plugin-tests
NEED_COMPILING=1
PLUGIN_PATH=~/src/joplin/packages/app-cli/tests/support/plugins/imaging
if [[ $NEED_COMPILING == 1 ]]; then
mkdir -p "$TEMP_PATH"
PLUGIN_NAME=$(echo "$PLUGIN_PATH" | awk -F/ '{print $NF}')
TEMP_PLUGIN_PATH="$TEMP_PATH/$PLUGIN_NAME"
echo "Copying from: $PLUGIN_PATH"
echo "To: $TEMP_PLUGIN_PATH"
2024-10-12 13:08:37 +02:00
rsync -a --exclude "cache/" --exclude "node_modules" --delete "$PLUGIN_PATH/" "$TEMP_PLUGIN_PATH/"
2024-10-12 13:08:37 +02:00
cd "$TEMP_PLUGIN_PATH/"
NODE_OPTIONS=--openssl-legacy-provider npm install
cd "$SCRIPT_DIR"
yarn start --dev-plugins "$TEMP_PLUGIN_PATH"
else
yarn start --dev-plugins "$PLUGIN_PATH"
fi
# Add eg "--profile $HOME/.config/joplindev-desktop-1" to test with a different profile