-
Notifications
You must be signed in to change notification settings - Fork 5
/
refreshPlugin.sh
executable file
·51 lines (39 loc) · 1.23 KB
/
refreshPlugin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
echo 'Killing the Stream Deck process'
if [[ "$OSTYPE" == "msys" ]]; then
taskkill //IM "StreamDeck.exe" //F
else
pkill 'Stream Deck'
fi
pluginName='com.thibautsabot.streamdeck.smartthings'
if [[ "$OSTYPE" == "msys" ]]; then
pluginsDir="$HOME\AppData\Roaming\Elgato\StreamDeck\Plugins"
else
pluginsDir="$HOME/Library/Application Support/com.elgato.StreamDeck/Plugins"
fi
projectDir=$(PWD)
echo 'Building from sources'
npm run build
echo "Installing the $pluginName plugin to $pluginsDir"
# Push the plugins directory on the stack
pushd "$pluginsDir"
# Check if the plugin directory exists and remove it
[ -d "$pluginName.sdPlugin" ] && rm -r $pluginName.sdPlugin
# Create the plugins directory
mkdir $pluginName.sdPlugin
# Copy content from local folder to Application folder
if [[ "$OSTYPE" == "msys" ]]; then
cp -R "$projectDir/$pluginName.sdPlugin" .
else
cp -R "$projectDir/$pluginName.sdPlugin/" $pluginName.sdPlugin
fi
# Pop the plugins directory off the stack returning to where we were
popd
echo "Done installing ${pluginName}"
# Reopen the Stream Deck app on background
if [[ "$OSTYPE" == "msys" ]]; then
"C:\Program Files\Elgato\StreamDeck\StreamDeck.exe" &
else
open /Applications/Elgato\ Stream\ Deck.app &
fi
exit