forked from qsys-plugins/PluginCompile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopy_plugin.sh
More file actions
29 lines (26 loc) · 917 Bytes
/
Copy pathcopy_plugin.sh
File metadata and controls
29 lines (26 loc) · 917 Bytes
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
#!/bin/sh
curdir="$(pwd)"
regexp='^[\\/][\\/][^\\/]*[\\/][^\\/]*'
if [ -n "$(echo "$curdir" | grep $regexp)" ]; then
echo "Current Directory is in Network"
profile="$(echo "$curdir" | sed "s/\($regexp\).*/\1/")"
[ -d "$profile/$pluginsDir" ] &&
USERPROFILE="$profile" &&
echo "USERPROFILE changed to-> $USERPROFILE"
else
curdir="$1"
fi
[ -z "${USERPROFILE}" ] && USERPROFILE="$HOME"
pluginsPath='Documents/QSC/Q-Sys Designer/Plugins'
rm "info.lua-E" 2>/dev/null | true
cd "${USERPROFILE}"
mkdir -p "${pluginsPath}"
if [ -e "${curdir}/${2}.qplugx" ]; then
echo "Copying encrypted plugin to ${USERPROFILE}/${pluginsPath}/${2}.qplugx"
cp "${curdir}/${2}.qplugx" \
"${USERPROFILE}/${pluginsPath}/${2}.qplugx"
else
echo "Copying plugin to ${USERPROFILE}/${pluginsPath}/${2}.qplug"
cp "${curdir}/${2}.qplug" \
"${USERPROFILE}/${pluginsPath}/${2}.qplug"
fi